Am I making a thing that activates a script correctly?
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.
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.
- real_trisk
- Posts: 152
- Joined: Wed Sep 24, 2008 11:19 am
- Location: Minnesota, USA
- Contact:
Am I making a thing that activates a script correctly?
OK, I've figured out and this works perfectly, and I think it's right, but I want to make sure. I want to make a thing that can cause a level change when used by the player. I want to then place the thing in front of doors in a stairwell so that each door will lead to another floor of the hotel. I created an actor thus:
ACTOR AAStairCTRL1 980 //Controller to make player change level by using a doorway in the stairwells. I hope. Don't know how to do it yet.
{
height 68
radius 21
deathheight 0
+SOLID
-SHOOTABLE
+NOBLOOD
+DONTTHRUST
+USESPECIAL
Xscale 0.111 //Ignore these, they are here just so I can see the thing until I get it working, will be removed later
Yscale 0.0725
States
{
Spawn:
TRER M -1
loop
Death:
stop
}
}
I have the thing's action set to execute a level changing script. Is that what +USESPECIAL does: Activate the actor's action in map?
It works perfectly, but I want to make sure I've done it right due to how confusing the wiki is about the subject.
Thanks,
Ben
ACTOR AAStairCTRL1 980 //Controller to make player change level by using a doorway in the stairwells. I hope. Don't know how to do it yet.
{
height 68
radius 21
deathheight 0
+SOLID
-SHOOTABLE
+NOBLOOD
+DONTTHRUST
+USESPECIAL
Xscale 0.111 //Ignore these, they are here just so I can see the thing until I get it working, will be removed later
Yscale 0.0725
States
{
Spawn:
TRER M -1
loop
Death:
stop
}
}
I have the thing's action set to execute a level changing script. Is that what +USESPECIAL does: Activate the actor's action in map?
It works perfectly, but I want to make sure I've done it right due to how confusing the wiki is about the subject.
Thanks,
Ben
Re: Am I making a thing that activates a script correctly?
Why not just run the script from a line action like normal instead of using a thing? Not sure I follow why a thing is needed.
- real_trisk
- Posts: 152
- Joined: Wed Sep 24, 2008 11:19 am
- Location: Minnesota, USA
- Contact:
Re: Am I making a thing that activates a script correctly?
Because it is in a stairwell with a bunch of floors, one door over the other floor after floor. One linedef can't, to my knowledge, be used to make multiple doors that go to multiple floors...
- ramon.dexter
- Posts: 1519
- Joined: Tue Oct 20, 2015 12:50 pm
- Graphics Processor: nVidia with Vulkan support
- Location: Kozolupy, Bohemia
Re: Am I making a thing that activates a script correctly?
I think this was solved a while ago... And it is impossible. This is just impossie in 2D engine.
- real_trisk
- Posts: 152
- Joined: Wed Sep 24, 2008 11:19 am
- Location: Minnesota, USA
- Contact:
Re: Am I making a thing that activates a script correctly?
Yes, unless there is a way to have a script check the player's vertical coordinates, it must be done with sprites. That's why I'm asking if I have this coded properly. I have it already working this way, so I'm just checking if it is proper, nothing more.
Last time I muddled my way through doing something, it ended up being changed in subsequent versions of GZDoom, making more work for me.
Last time I muddled my way through doing something, it ended up being changed in subsequent versions of GZDoom, making more work for me.
- ramon.dexter
- Posts: 1519
- Joined: Tue Oct 20, 2015 12:50 pm
- Graphics Processor: nVidia with Vulkan support
- Location: Kozolupy, Bohemia
Re: Am I making a thing that activates a script correctly?
No, it is not proper. What you need is a script that checks players Z coordinate.
- real_trisk
- Posts: 152
- Joined: Wed Sep 24, 2008 11:19 am
- Location: Minnesota, USA
- Contact:
Re: Am I making a thing that activates a script correctly?
What is the +USESPECIAL flag for, then?
- ramon.dexter
- Posts: 1519
- Joined: Tue Oct 20, 2015 12:50 pm
- Graphics Processor: nVidia with Vulkan support
- Location: Kozolupy, Bohemia
Re: Am I making a thing that activates a script correctly?
Ask rachael for better answer. I'm sorry, but I dont fully understand why it is a hack. But I remember that this was solved a while ago and closed with that its a hack.
- StrikerMan780
- Posts: 485
- Joined: Tue Nov 29, 2005 2:15 pm
- Graphics Processor: nVidia with Vulkan support
- Contact:
Re: Am I making a thing that activates a script correctly?
The code looks OK, but if you want to do anything else with the activating player, you may want to set an activation property for the actor: https://zdoom.org/wiki/Actor_properties#Activation