I set some actors flags on some actor and then want reset actor flags to flags set by default.
How do so without creating loop which set ALL AVAILABLE ACTOR FLAGS, except some, to false?
Internally this can be done done by bit shift operation, but in zscript flags transformed to bools, so this is dont work.
Reset actor flags
Moderator: GZDoom Developers
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.
Please bear in mind that the people helping you do not automatically know how much you know. You may be asked to upload your project file to look at. Don't be afraid to ask questions about what things mean, but also please be patient with the people trying to help you. (And helpers, please be patient with the person you're trying to help!)
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.
Please bear in mind that the people helping you do not automatically know how much you know. You may be asked to upload your project file to look at. Don't be afraid to ask questions about what things mean, but also please be patient with the people trying to help you. (And helpers, please be patient with the person you're trying to help!)
- Void Weaver
- Posts: 724
- Joined: Thu Dec 18, 2014 7:15 am
- Contact:
Re: Reset actor flags
Well dunno can it be helpful or not, but wiki says that Revive() do restore all default flags.
Seems that there are all flags restores via a some GetDefault() function:
AActor *info = GetDefault();
flags = info->flags;
flags2 = info->flags2;
flags3 = info->flags3;
flags4 = info->flags4;
flags5 = info->flags5;
flags6 = info->flags6;
flags7 = info->flags7;
Btw, looks that other reviving functions do restore flags by the similar manner.
Seems that there are all flags restores via a some GetDefault() function:
AActor *info = GetDefault();
flags = info->flags;
flags2 = info->flags2;
flags3 = info->flags3;
flags4 = info->flags4;
flags5 = info->flags5;
flags6 = info->flags6;
flags7 = info->flags7;
Btw, looks that other reviving functions do restore flags by the similar manner.
- Graf Zahl
- Lead GZDoom+Raze Developer
- Posts: 49252
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: Reset actor flags
That won't help because this function does more.
- Void Weaver
- Posts: 724
- Joined: Thu Dec 18, 2014 7:15 am
- Contact:
Re: Reset actor flags
So GetDefault() doesn't allow to get partial (only flags for ex.) default info?
Re: Reset actor flags
MyActor.bSOMEFLAG = MyActor.Default.bSOMEFLAG; ?
- Graf Zahl
- Lead GZDoom+Raze Developer
- Posts: 49252
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: Reset actor flags
GetDefault only gets you a reference to the actor's default. You still have to change everything you need manually.Void Weaver wrote:So GetDefault() doesn't allow to get partial (only flags for ex.) default info?
- 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:
Re: Reset actor flags
Flags are stored in an int, aren't they? Would it be possible to just set that int to getdefaultbytype(classname).thatint?
- Graf Zahl
- Lead GZDoom+Raze Developer
- Posts: 49252
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: Reset actor flags
The 8 flag ints are not accessible from ZScript - only the separate bits.