
Is it possible to control an actor sprites through script?
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!)
Is it possible to control an actor sprites through script?
I really want to know if controlling or forcing an actor sprite to enter specific state (especially the player actor) for a cut-scene purpose is possible through script. According to my experience, it kinda possible but in very messy way, involving dummy actor and need perfect timing to execute the script
. So perhaps anyone in here can shed some light or explain how to do this if possible?

- 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: Is it possible to control an actor sprites through scrip
SetStateLabel
Not sure if you want it to do that to the player though... it might be safer to spawn a new actor that inherits the player's sprite and translation and manipulate that.
Not sure if you want it to do that to the player though... it might be safer to spawn a new actor that inherits the player's sprite and translation and manipulate that.
Re: Is it possible to control an actor sprites through scrip
Okay so just i ran minor test about SetActorState on a custom monster (BFG Guy) to enter his "missile" state. Yes the monster did enter the "missile" state, however, he doesn't fire BFG projectile at all instead just played the "missile" state animation only. Did i do anything wrong? or maybe i have to put a map spot on front of him to spawn BFG Ball?Ichor wrote:SetActorState might work.
Ah well just what i'm afraid of but nevertheless you're right, it will be much simpler and safer to use dummy actor. TBH, I'm not familiar with what you just showed me in that link like how, where and when to use it. Is there any map sample which using that stuff so i can learn it?Matt wrote:SetStateLabel
Not sure if you want it to do that to the player though... it might be safer to spawn a new actor that inherits the player's sprite and translation and manipulate that.
-
- Posts: 5043
- Joined: Sun Nov 14, 2010 12:59 am
Re: Is it possible to control an actor sprites through scrip
It most probably didn't have a target to shoot at; A_CustomMissile doesn't spawn a projectile if the calling actor doesn't have a target.Boomer666 wrote:Yes the monster did enter the "missile" state, however, he doesn't fire BFG projectile at all instead just played the "missile" state animation only. Did i do anything wrong?
- Arctangent
- Posts: 1235
- Joined: Thu Nov 06, 2014 1:53 pm
- Contact:
Re: Is it possible to control an actor sprites through scrip
It's [wiki]ZScript[/wiki], which isn't tied to a map but the entire mod. Probably not the best thing to be coding cutscenes with.Boomer666 wrote:Ah well just what i'm afraid of but nevertheless you're right, it will be much simpler and safer to use dummy actor. TBH, I'm not familiar with what you just showed me in that link like how, where and when to use it. Is there any map sample which using that stuff so i can learn it?
Re: Is it possible to control an actor sprites through scrip
Now you mentioned it, i did check the friendly flag on both calling and target actor in the editor hoping to get clean cut-scene for result but unfortunately, that is the very reason why the calling actor (BFG Guy) doesn't spawn his projectile (unless there is a way i'm unaware of to force him to spawn his projectile).Blue Shadow wrote: It most probably didn't have a target to shoot at; A_CustomMissile doesn't spawn a projectile if the calling actor doesn't have a target.
Now if i unchecked friendly flag on target that just kinda defeat the purpose of this cut-scene and the result will be more like wandering gladiators. So what do you suggest to make the calling actor to spawn his projectile?
Offf... i don't think that is the best option either since i don't have any knowledge/experience at all.Arctangent wrote:It's [wiki]ZScript[/wiki], which isn't tied to a map but the entire mod. Probably not the best thing to be coding cutscenes with.