How do i...

Advanced OpenGL source port fork from ZDoom, picking up where ZDoomGL left off.
[Home] [Download] [Git builds (Win)] [Git builds (Mac)] [Wiki] [Repo] [Bugs&Suggestions]

Moderator: Graf Zahl

Locked
User avatar
Lioyd_Irving
Posts: 122
Joined: Sun Dec 30, 2007 15:44
Location: Where ?

How do i...

Post 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 ?
Jack the Ripper, Charles Manson and Adolf Hitler all drank water. You criminal scum !
User avatar
Enjay
Developer
Developer
Posts: 4748
Joined: Tue Aug 30, 2005 23:19
Location: Scotland
Contact:

Post 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
User avatar
ellmo
DRD Team Admin (Inactive)
Posts: 237
Joined: Thu Jun 30, 2005 13:30
Location: Poland, Poznan

Post 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);
}
User avatar
Enjay
Developer
Developer
Posts: 4748
Joined: Tue Aug 30, 2005 23:19
Location: Scotland
Contact:

Post 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.
User avatar
TheDarkArchon
Posts: 1000
Joined: Wed Jul 06, 2005 11:58
Location: What's that fucking smell
Contact:

Post 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).
User avatar
Lioyd_Irving
Posts: 122
Joined: Sun Dec 30, 2007 15:44
Location: Where ?

Post by Lioyd_Irving »

All three doesn't work.
Jack the Ripper, Charles Manson and Adolf Hitler all drank water. You criminal scum !
User avatar
Enjay
Developer
Developer
Posts: 4748
Joined: Tue Aug 30, 2005 23:19
Location: Scotland
Contact:

Post by Enjay »

All three work perfectly because I've used all three. You must be doing something wrong. Care to share your code?
Locked

Return to “GZDoom”