How do i...
Moderator: Graf Zahl
- Lioyd_Irving
- Posts: 122
- Joined: Sun Dec 30, 2007 15:44
- Location: Where ?
How do i...
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 ?
Jack the Ripper, Charles Manson and Adolf Hitler all drank water. You criminal scum !
- Enjay
- Developer
- Posts: 4748
- Joined: Tue Aug 30, 2005 23:19
- Location: Scotland
- Contact:
You could define your own custom player class and make it an item that your class starts with.
http://zdoom.org/wiki/Classes:PlayerPawn
http://zdoom.org/wiki/Classes:PlayerPawn
- ellmo
- DRD Team Admin (Inactive)
- Posts: 237
- Joined: Thu Jun 30, 2005 13:30
- Location: Poland, Poznan
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:
To my knowlege, something like this would be enough:
Code: Select all
script 1 enter
{
GiveInventory("unarmed", 1);
}
- Enjay
- Developer
- Posts: 4748
- Joined: Tue Aug 30, 2005 23:19
- Location: Scotland
- Contact:
And if the mod is for GZdoom, rather than Zdoom, you can use fragglescript.
Make and FSGLOBAL lump and stick it in your WAD
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.
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);
- TheDarkArchon
- Posts: 1000
- Joined: Wed Jul 06, 2005 11:58
- Location: What's that fucking smell
- Contact:
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).
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).
- Lioyd_Irving
- Posts: 122
- Joined: Sun Dec 30, 2007 15:44
- Location: Where ?
- Enjay
- Developer
- Posts: 4748
- Joined: Tue Aug 30, 2005 23:19
- Location: Scotland
- Contact: