Code: Select all
POSS A 5 {
A_Flash
A_FacePlayer
}
Code: Select all
TNT1 A 0 A_Flash
TNT1 A 0 A_FacePlayer
POSS A 5
Moderator: GZDoom Developers
Code: Select all
POSS A 5 {
A_Flash
A_FacePlayer
}
Code: Select all
TNT1 A 0 A_Flash
TNT1 A 0 A_FacePlayer
POSS A 5
Why do people always use TNT1 for zero length states?jmickle wrote:Instead of having to have multiple null states to call more than one action in a frame, it'd be more user-friendly to be able to group them in a syntax like this:
this could be implemented with a quick pre-parse to change those sections to look like this:Code: Select all
POSS A 5 { A_Flash A_FacePlayer }
Code: Select all
TNT1 A 0 A_Flash TNT1 A 0 A_FacePlayer POSS A 5
Code: Select all
POSS A 0 A_Flash
POSS A 5 A_FacePlayer
Code: Select all
Function A_FlashPlayer
{
A_Flash;
A_FacePlayer;
}
Code: Select all
POSS A 5 A_FlashPlayer
Code: Select all
POSS A 0 A_Flash
POSS A 5 A_FacePlayer
No, it's to make the syntax easier to write and read.RaveYard wrote:I don't wanna sound like an a**hole, but is there any reason to implement this feature besides just... making the syntax look fancy and complex?
Given that your suggestion only saves on a sprite name and duration for each pointer, I personally don't really think it makes that much difference. Copying and pasting isn't that tough and I'm not convinced that the new code is any more readable or approachable from an end user perspective. I've nothing particularly against the idea but I don't see it being hugely beneficial, especially if it might interfere with or be superseded by DoomScript at some point.jmickle wrote:Enjay: my example was only 2 lines but it becomes a pain for more actions, and having to do it repetitively. It's a convenience issue.
There's a trick where you use a [wiki]CustomInventory[/wiki] item to accomplish all the actions at once. It's a bit hacky though.jmickle wrote:Enjay: my example was only 2 lines but it becomes a pain for more actions, and having to do it repetitively. It's a convenience issue.
[wiki]DoomScript[/wiki]jmickle wrote:This is the first I've heard of DoomScript, is there anything I can read about it?
You will be able to with doomscript. According to Graf, it's a lower level language than DECORATE and ACS, but still higher than C++.NeuralStunner wrote:I always imagined you'd be able to make your own "action pointers", making it trivial to stack elaborate functions onto a single state.
So I guess being able to access internal actor functions like OkayToSwitchTarget and TakeSpecialDamage, etc would still be forbidden, huh?Major Cooke wrote:...but still higher than C++.
If you really want an answer, it just looks neater and easier to keep that way if you're copying code from multiple different actors. ("What's this TROO H doing in this shotgun guy?")Gez wrote:Why do people always use TNT1 for zero length states?
Code: Select all
FOOB R 12
{
A_Foobar("Foobar")
A_Foobar1
A_Foobar2("Foobar")
goto Foobar
A_Foobar2If(user_foobar==2,"Foobar",1,2,3,4,5,6,7,8,9)
A_Foobar3(15,"Foobar")
A_Foobar4(111,222,333)
A_FoobarEx("FoobarFatShot",1,2,3,4,5,6,7,8,9)
}
Code: Select all
FOOB R 0 A_Foobar("Foobar")
FOOB R 0 A_Foobar1
FOOB R 0 A_Foobar2("Foobar")
goto Foobar
FOOB R 0 A_Foobar2If(user_foobar==2,"Foobar",1,2,3,4,5,6,7,8,9)
FOOB R 0 A_Foobar3(15,"Foobar")
FOOB R 0 A_Foobar4(111,222,333)
FOOB R 12 A_FoobarEx("FoobarFatShot",1,2,3,4,5,6,7,8,9)
That's usually when I use it. Generally, I use sprite appropriate to the actor but if I am copying between a bunch of different actors using different sprites, then I will tend to use TNT1 for 0 duration frames to save me having to edit the text every time I paste it into a new actor.Vaecrius wrote:if you're copying code from multiple different actors.