Page 1 of 1
How do i...
Posted: Mon Jan 07, 2008 8:31
by Lioyd_Irving
I'm making a mod for D2. I want a modified version of the "Unarmed" weapon from the WRW to replace the fist, but i have to type "give unarmed" on the console when i play it. How do I avoid that so the weapon is given at the beginning ?
Posted: Mon Jan 07, 2008 15:19
by Enjay
You could define your own custom player class and make it an item that your class starts with.
http://zdoom.org/wiki/Classes:PlayerPawn
Posted: Mon Jan 07, 2008 19:42
by ellmo
Or you can wite a script that gives the "unarmed" weapon class right at the beginning. Which is primitive, but might prevent you from doing something more complicated you won't fully understand.
To my knowlege, something like this would be enough:
Code: Select all
script 1 enter
{
GiveInventory("unarmed", 1);
}
Posted: Mon Jan 07, 2008 21:26
by Enjay
And if the mod is for GZdoom, rather than Zdoom, you can use fragglescript.
Make and FSGLOBAL lump and stick it in your WAD
Code: Select all
[scripts]
//include("lspec.h");
script 1
{
if (!checkinventory(0, "QuestItem1",1))
{
takeinventory(0, "Fist");
giveinventory(0, "Unarmed");
giveinventory(0, "QuestItem1");
}
}
startscript(1);
The stuff with "questitem" is just to ensure the exchange doesn't happen every time you visit a new map (FSGLOBAL is run at the start of each map). Although, with these weapons not using ammo (as far as I know with the unarmed), that's less of an issue.
Posted: Tue Jan 08, 2008 12:27
by TheDarkArchon
You can also check vs. unarmed as well.
The best way to go would be the player class thing, as it's least prone to breaking out of the three possible methods (FSGLOBAL breaks should there be anything in the map header, Global ACS libraries can break if there is a duplicate script number within a level, classes can only potentially break WADs that have custom classes in them already but so far the only one I know of is UTNT and a handful of weapon mods and even then the classes in UTNT are similar enough to the Doomguy for it not to matter too much).
Posted: Mon Jan 21, 2008 12:37
by Lioyd_Irving
All three doesn't work.
Posted: Mon Jan 21, 2008 13:22
by Enjay
All three work perfectly because I've used all three. You must be doing something wrong. Care to share your code?