SetActorState:A question about future custom states support

Moderator: GZDoom Developers

User avatar
Nash
 
 
Posts: 17505
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia
Contact:

Post by Nash »

Added suggestion for an ACS function to retrieve the actor's state name.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49252
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Post by Graf Zahl »

An actor doesn't 'have' a state name so there's nothing to retrieve.
User avatar
Nash
 
 
Posts: 17505
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia
Contact:

Post by Nash »

Ah alright then. It's no big deal.

I should be able to do what I had in mind through inventory hacks.
User avatar
eliw00d
Posts: 585
Joined: Sun Oct 17, 2004 2:46 pm
Location: Duluth, MN
Contact:

Post by eliw00d »

is there/will there be custom states for weapons?
User avatar
TheDarkArchon
Posts: 7656
Joined: Sat Aug 07, 2004 5:14 am
Location: Some cold place

Post by TheDarkArchon »

I think there are. Why wouldn't there be?
User avatar
Matt
Posts: 9696
Joined: Sun Jan 04, 2004 5:37 pm
Preferred Pronouns: They/Them
Operating System Version (Optional): Debian Bullseye
Location: Gotham City SAR, Wyld-Lands of the Lotus People, Dominionist PetroConfederacy of Saudi Canadia
Contact:

Post by Matt »

They work in the latest GZDoom right now.
User avatar
TheDarkArchon
Posts: 7656
Joined: Sat Aug 07, 2004 5:14 am
Location: Some cold place

Post by TheDarkArchon »

Which means yes: GZDoom's custom state implementation is ZDoom's future one so if your DECORATE is coughing up errors in GZDoom, it'll cough up the same errors (aside from GZDoom bugs) come 2.1.8.
User avatar
eliw00d
Posts: 585
Joined: Sun Oct 17, 2004 2:46 pm
Location: Duluth, MN
Contact:

Post by eliw00d »

is there any way to use A_Jump and the other jump actions to jump to a state and not a certain number of frames? i tried it with a weapon actor and it says the actor does not have that state or something like that.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49252
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Post by Graf Zahl »

A_Jump can jump to labels. This feature is being used by some of the stuff in zdoom.pk3. It may still have a few bugs though.
User avatar
Nash
 
 
Posts: 17505
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia
Contact:

Post by Nash »

Randy, any news or comments on this? Is it difficult to implement? Just wondering. I would use this feature to make my side scroller use less hacks.
User avatar
randi
Site Admin
Posts: 7749
Joined: Wed Jul 09, 2003 10:30 pm
Contact:

Post by randi »

No news, because I forgot about it. I was going to try to get a new release out today, but now I feel like I should include this too.
User avatar
Zippy
Posts: 3302
Joined: Wed Mar 23, 2005 5:31 pm
Location: New Jersey

Post by Zippy »

randy, in reply to post #1, wrote:I don't see why not. I'm moving this to feature suggestions to make sure I don't forget about it.
randy, later on, wrote:No news, because I forgot about it.
The best laid plans...
User avatar
randi
Site Admin
Posts: 7749
Joined: Wed Jul 09, 2003 10:30 pm
Contact:

Post by randi »

There you go:

Code: Select all

int SetActorState (int tid, str statename, optional bool exact);
If tid is 0, it affects the script activator, otherwise it affects all the matching actors. Statename is the name of the state you want to put the actor in. The final parameter, exact, specifies whether or not partial state name matches are accepted. If you don't specify it or set it to false, if you try to do something like:

Code: Select all

SetActorState (0, "Foo.Bar");
and the actor has a Foo state but no Foo.Bar state, it will enter the Foo state. If you set exact to true:

Code: Select all

SetActorState (0, "Foo.Bar", true);
then the actor must have a Foo.Bar state, or it will not change state at all, even if it has a Foo state.

The return value for this function is the number of actors that successfully changed state. Note that you should refrain from using this function for any actors that use the monster AI, or unpredictable results could occur.
User avatar
Cutmanmike
Posts: 11354
Joined: Mon Oct 06, 2003 3:41 pm
Operating System Version (Optional): Windows 10
Location: United Kingdom
Contact:

Post by Cutmanmike »

Sweet.
randy wrote:Note that you should refrain from using this function for any actors that use the monster AI, or unpredictable results could occur.
This the same for players I take it?
User avatar
Shadelight
Posts: 5113
Joined: Fri May 20, 2005 11:16 am
Location: Labrynna

Post by Shadelight »

Awesome, this will work for all kinds of stuff, I can't wait tell the next GZDoom comes out now. :D
Post Reply

Return to “Closed Feature Suggestions [GZDoom]”