ZDaemon Forum Index ZDaemon
Client/Server DOOM
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

[Dehacked] JumpIfArgs

 
Post new topic   Reply to topic    ZDaemon Forum Index -> Pending Requests
View previous topic :: View next topic  
Author Message
Body-Guard
Unstoppable!


Joined: 08 Jan 2006
Location: Hungary

PostPosted: Mon Jan 05, 2015 12:06 pm    Post subject: [Dehacked] JumpIfArgs Reply with quote

hi,

This is a new dehacked feature.
the point of this request is to simplify the creation of dehacked things. This codepointer is known in Decorate as JumpIf, which can be parameterized with arguments passed to a thing in the map editor.

Decorate syntax looks like this:

Code:
A_JumpIf(args[0] == 2, "Death")


The above command makes the actor jump to its death state when its first argument is set to 2 in the map editor.


How would this look like in dehacked and why is it useful?

It is a bit confusing now because 'Args' in the codepointer's name refers to the thing arguments in the map editor. Maybe it could be called JumpIfThingArgs to avoid confusion with frame arguments.

dehacked syntax:

Code:
JumpIfArgs (int which, int amount, int frame)

which: map editor thing argument number (values from 1 to 5 valid (inclusive))
amount: the value of the argument set in the map editor
frame: jump to this frame if the given argument's value equals to amount. Else go to next frame.



example:

the following image shows the argument 1 of the thing set to 5 in the map editor:

http://destiny-server.no-ip.org/stuff/args.jpg

Code:
Frame 300
Args1 = 1
Args2 = 5
Args3 = 310
Duration = 1
Next frame = 301

[CODEPTR]
Frame 300 = JumpIfArgs


The code snippet causes the thing to jump to frame 310, because it has its first argument set to 5 in the map editor.


This is useful for example to merge many decorative objects into one single actor. Lets say you have 10 different kind of rocks, and right now you need to replace a dehacked thing for each of them, resulting in 10 different things. Using this method, you only must replace one thing, then use the map editor to set a number in its argument field, which then decides which frame will be displayed. A different argument value means a different variant of rock by jumping to the proper frame.
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Body-Guard
Unstoppable!


Joined: 08 Jan 2006
Location: Hungary

PostPosted: Fri Apr 03, 2015 9:34 am    Post subject: Reply with quote

To show you one of my work in progress that could greatly benefit from this feature:

Code:
# Doomednum; Modname; Internalname

*FLARES*
---------
15200;    White Flare Large 1;     SkullHang35
15201;    White Flare Large 2;     SkullHang45
15202;    White Flare Large 3;     SkullHang60
15203;    White Flare Large 4;     SkullHang70
15204;    White Flare Large 5;     SmallPillar
15205;    White Flare Large 6;     StalactiteLarge
15206;    White Flare Medium 1;    StalactiteSmall
15207;    White Flare Medium 2;    StalagmiteLarge
15208;    White Flare Medium 3;    StalagmiteSmall
15209;    White Flare Medium 4;    ZShroomLarge1
15210;    White Flare Medium 5;    ZShroomLarge2
15211;    White Flare Medium 6;    ZShroomLarge3
15212;    White Flare Small 1;     ZShroomSmall1
15213;    White Flare Small 2;     ZShroomSmall2
15214;    White Flare Small 3;     ZShroomSmall3
15215;    White Flare Small 4;     ZShroomSmall4
15216;    White Flare Small 5;     ZShroomSmall5
15217;    White Flare Small 6;     ZPosionShroom
15218;    Yellow Flare Large 1;    ZStalactiteIceLarge
15219;    Yellow Flare Large 2;    ZStalactiteIceMedium
15220;    Yellow Flare Large 3;    ZStalactiteIceSmall
15221;    Yellow Flare Large 4;    ZStalactiteIceTiny
15222;    Yellow Flare Large 5;    ZStalagmiteIceLarge
15223;    Yellow Flare Large 6;    ZStalagmiteIceMedium
15224;    Yellow Flare Medium 1;   ZStalagmiteIceSmall
15225;    Yellow Flare Medium 2;   ZStalagmiteIceTiny
15226;    Yellow Flare Medium 3;   ZStalactiteLarge
15227;    Yellow Flare Medium 4;   ZStalactiteMedium
15228;    Yellow Flare Medium 5;   ZStalactiteSmall
15229;    Yellow Flare Medium 6;   ZStalagmiteLarge
15230;    Yellow Flare Small 1;    ZStalagmiteMedium
15231;    Yellow Flare Small 2;    ZStalagmiteSmall
15232;    Yellow Flare Small 3;    ZStalagmitePillar
15233;    Yellow Flare Small 4;    ZStumpBare
15234;    Yellow Flare Small 5;    ZStumpBurned
15235;    Yellow Flare Small 6;    ZStumpSwamp1
15236;    Orange Flare Large 1;    ZStumpSwamp2
15237;    Orange Flare Large 2;    ZSwampVine
15238;    Orange Flare Large 3;    ZTree
15239;    Orange Flare Large 4;    ZTreeDead
15240;    Orange Flare Large 5;    ZTreeGnarled1
15241;    Orange Flare Large 6;    ZTreeGnarled2
15242;    Orange Flare Medium 1;   ZTreeLarge1
15243;    Orange Flare Medium 2;   ZTreeLarge2
15244;    Orange Flare Medium 3;   ZTreeSwamp120
15245;    Orange Flare Medium 4;   ZTreeSwamp150
15246;    Orange Flare Medium 5;   ZXmasTree
15247;    Orange Flare Medium 6;   ZChainBit32
15248;    Orange Flare Small 1;    ZChainBit64
15249;    Orange Flare Small 2;    ZChainEndHeart
15250;    Orange Flare Small 3;    ZChainEndHook1
15251;    Orange Flare Small 4;    ZChainEndHook2
15252;    Orange Flare Small 5;    ZChainEndSkull
15253;    Orange Flare Small 6;    ZChainEndSpike
15254;    Red Flare Large 1;       ZStatueGargoyleBlueShort
15255;    Red Flare Large 2;       ZStatueGargoyleBlueTall
15256;    Red Flare Large 3;       ZStatueGargoyleDarkRedShort
15257;    Red Flare Large 4;       ZStatueGargoyleDarkRedTall
15258;    Red Flare Large 5;       ZStatueGargoyleGreenShort
15259;    Red Flare Large 6;       ZStatueGargoyleGreenTall
15260;    Red Flare Medium 1;      ZStatueGargoyleRedShort
15261;    Red Flare Medium 2;      ZStatueGargoyleRedTall
15262;    Red Flare Medium 3;      ZStatueGargoyleRustShort
15263;    Red Flare Medium 4;      ZStatueGargoyleRustTall
15264;    Red Flare Medium 5;      ZStatueGargoyleStripeTall
15265;    Red Flare Medium 6;      ZStatueGargoyleTanShort
15266;    Red Flare Small 1;       Pottery1
15267;    Red Flare Small 2;       Pottery2
15268;    Red Flare Small 3;       Pottery3
15269;    Red Flare Small 4;       PotteryBit
15270;    Red Flare Small 5;       TableShit1
15271;    Red Flare Small 6;       TableShit2




The only difference are the color and size of the flares. All of this could be done with one flare thing for each color using JumpIfArgs in their frames. Then I could set the first thing argument in doom builder to determine in which size it will appear on the map.
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Aeyesx
Dominating!


Joined: 13 Oct 2012

PostPosted: Tue Oct 13, 2015 1:50 pm    Post subject: Reply with quote

+1, Would be very usefull for decorative objects
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    ZDaemon Forum Index -> Pending Requests All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group