Hi.
How can I teleport player to start position in ACS? All teleport functions needs destination ID, but not GetActorX,Y or Z.
And question 2, how can I make this in section USE in DECORATE (for effect as ChaosDevice/arti teleport in Hexen)?
Thanks guys and have a nice day.
acs script for teleport player to start position
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!)
-
LOZ_98
- Posts: 67
- Joined: Thu Mar 22, 2018 7:46 pm
- Graphics Processor: nVidia (Modern GZDoom)
Re: acs script for teleport player to start position
You can use SpawnSpot to spawn a TeleportDest2 at the player's location after they have entered the game, use ActivatorTID() to give it the same tag as the script activator and GetActorAngle(ActivatorTID()) to give it the same angle as the player who activated the script, as for using it in a DECORATE USE state you simply use ACS_ExecuteAlways(script) or ACS_NamedExecuteAlways(script name).
EDIT: forgot to mention that this method requires you to give the player a TID, using Thing_ChangeTID, there's an article on the wiki that shows how to use it if you're unsure what this means.
EDIT: forgot to mention that this method requires you to give the player a TID, using Thing_ChangeTID, there's an article on the wiki that shows how to use it if you're unsure what this means.
-
choosen
- Posts: 1
- Joined: Tue Oct 09, 2018 2:37 pm
Re: acs script for teleport player to start position
WellLOZ_98 wrote:You can use SpawnSpot to spawn a TeleportDest2 at the player's location after they have entered the game, use ActivatorTID() to give it the same tag as the script activator and GetActorAngle(ActivatorTID()) to give it the same angle as the player who activated the script, as for using it in a DECORATE USE state you simply use ACS_ExecuteAlways(script) or ACS_NamedExecuteAlways(script name).
EDIT: forgot to mention that this method requires you to give the player a TID, using Thing_ChangeTID, there's an article on the wiki that shows how to use it if you're unsure what this means.
In ACS:
script "start" enter
{
thing_changeTID(0,1000);
spawnSpot("TeleportDest2",1000,999,GetActorAngle(0)>>8);
}
script "porting" (void)
{
teleport(999);
}
and in DECORATE:
actor EmergencyTeleport : CustomInventory 6666
{
...
blablabla
....
states:
{
Spawn:
EMTP ABCDEFGHI 4 Bright Light("ImHere")
Loop
Use:
TNT1 A 0 acs_namedexecutealways("porting",0)
TNT1 A 0 A_log("Teleport to start position")
stop
}
}
Thanks you. Working good.