Need help with two features in DECORATE

Archive of the old editing forum
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. This forum is archived - please use this set of forums to ask new questions.
Locked
Falcor
Posts: 16
Joined: Tue Jan 05, 2010 4:47 am

Need help with two features in DECORATE

Post by Falcor »

Hi to all. I'm Falcor, and I have some problems with DECORATE-code.
The first one is interaction of objects. For example, I wanna create flaregun from Blood. Flares stuck in monsters after launch and hurt them by the fire for some seconds. I have no idea, how it must be realized in DECORATE.
The second problem is player-classes. I've made two classes and I do not want them to pick up weapon of another class. I tried to rip hexen.wad and gzdoom.pk3 for KEYCONF- and DECORATE-descriptions of Hexen-classes, but I haven't even found a clue.
Can you help me?
User avatar
Ryan Cordell
Posts: 4349
Joined: Sun Feb 06, 2005 6:39 am
Preferred Pronouns: No Preference
Operating System Version (Optional): Windows 10
Graphics Processor: nVidia (Modern GZDoom)
Location: Capital of Explodistan

Re: Need help with two features in DECORATE

Post by Ryan Cordell »

1) A_Fire (a codepointer used for the Archvile flame that lets it stick to the player) would help you, but try and track down LWM's Flaregun - it has all that you need.
2) You'll most likely have to use a CustomInventory (used as the weapon pickup) actor's Pickup state for this to work. Pickup state actually references the player, not the item itself, so if you're using A_Jump functions and such, it checks the player, so you can then have the player, say, have a specific dummy item all to himself, and then gain only the weapons his class allows.
Falcor
Posts: 16
Joined: Tue Jan 05, 2010 4:47 am

Re: Need help with two features in DECORATE

Post by Falcor »

Ryan Cordell wrote:LWM's Flaregun - it has all that you need.
Where can I find it?
Ryan Cordell wrote:2) You'll most likely have to use a CustomInventory (used as the weapon pickup) actor's Pickup state for this to work.
Is there any examples? I'm not sure, I get it rightly.

P.S. I also have another question. There's a boss-like creature in the last level in "Action Doom"-wad that throws boxes. How is it made? O_o
User avatar
Ryan Cordell
Posts: 4349
Joined: Sun Feb 06, 2005 6:39 am
Preferred Pronouns: No Preference
Operating System Version (Optional): Windows 10
Graphics Processor: nVidia (Modern GZDoom)
Location: Capital of Explodistan

Re: Need help with two features in DECORATE

Post by Ryan Cordell »

1) Flaregun - Also, sorry for pimping my old mod, but Demon Wars, if it's still available to get, has the flaregun in, I think. Try searching for that.
2) Not right off the bat, someone else or when I get home, I'll probably cook something up.
Falcor
Posts: 16
Joined: Tue Jan 05, 2010 4:47 am

Re: Need help with two features in DECORATE

Post by Falcor »

Ok, thanks for helping.
Falcor
Posts: 16
Joined: Tue Jan 05, 2010 4:47 am

Re: Need help with two features in DECORATE

Post by Falcor »

Hey, I really need some examples of these features
User avatar
Ryan Cordell
Posts: 4349
Joined: Sun Feb 06, 2005 6:39 am
Preferred Pronouns: No Preference
Operating System Version (Optional): Windows 10
Graphics Processor: nVidia (Modern GZDoom)
Location: Capital of Explodistan

Re: Need help with two features in DECORATE

Post by Ryan Cordell »

Dang it, of all things to forget right after I post.

Well, here's only something for question 2:

Code: Select all

ACTOR Jimmy : PlayerPawn
{
...
   States
   {
   Spawn:
	PLAY A 0
	PLAY A 0 A_GiveInventory("Player1")
      PLAY A -1
      stop
   }
}

ACTOR Bimmy : PlayerPawn
{
...
   States
   {
   Spawn:
	PLA2 A 0
	PLA2 A 0 A_GiveInventory("Player2")
      PLA2 A -1
      stop
   }
}

ACTOR Weapon : CustomInventory
{
   Inventory.PickupMessage " "
    Scale 0.8
      +FLOORCLIP
      +INVENTORY.IGNORESKILL
   States
   {
   Spawn:
      SMGP A 1
      Loop
   Pickup:
	SMGP A 0 A_JumpIfInventory("Player1",1,"Pickup.Player1")
	SMGP A 0 A_JumpIfInventory("Player2",1,"Pickup.Player2")
      Stop
   Pickup.Player1:
	SMGP A 0 A_GiveInventory("Playboy",1)
	SMGP A 0 A_Print("Acquired a naughty magazine!")
      Stop
   Pickup.Player2:
	SMGP A 0 A_GiveInventory("Ceeb",1)
	SMGP A 0 A_Print("Acquired Ceeb! Wait, what?")
      Stop
   }
}

ACTOR Player1 : Inventory
{
   Inventory.Amount 1
   Inventory.MaxAmount 1
      +INVENTORY.IGNORESKILL
}

ACTOR Player2 : Player1 {}

.. Something like that.

Also, if you want to change the weapon's graphic, depending on which player is selected, you'll probably have to resort to ACS and using SetActorState or some such.
Falcor
Posts: 16
Joined: Tue Jan 05, 2010 4:47 am

Re: Need help with two features in DECORATE

Post by Falcor »

Oh, thank you. It's pretty useful example.
Locked

Return to “Editing (Archive)”