Vartex Posted November 16, 2015 Share Posted November 16, 2015 Hello there JKHub. I need your help with Icarus scripting. I am trying to teleport a player using mentioned scripting, but so far I am failing at it.The idea is that, player spawns inside a trigger_multiple which automatically triggers a target_scriptrunner which executes an Icarus script that teleports player to certain locations based on his SET_PARM1 (that he can manage across the map). This is how the trigger_multiple's syntax looks likeThis is how the target_scriprunner's syntax looks likeThis is the code of the script itself (implying SET_PARM1 is 0 unless set otherwise) if ( $get( FLOAT, "SET_PARM1" ) = 0.000000$ ) { use ( "tele_start" ); } else ( ) { if ( $get( FLOAT, "SET_PARM1" ) = 1.000000$ ) { use ( "tele_1" ); } else ( ) { use ( "tele_2" ); } } The use functions should than teleport player to a target_position that is placed somewhere on the map. It's syntax looks like this. Any ideas what am I doing wrong? All kinds of help is appreciatedEDIT: Oops, just realized I posted this into the wrong forum section. Sorry about that. Could you please move it for me if possible? Link to comment
mrwonko Posted November 17, 2015 Share Posted November 17, 2015 I moved the thread to the right section. Numerous things:When using an entity, you supply its targetname, not its script_targetname; the latter is for running scripts on entities, but if I remember correctly use takes the targetname.Just an optimization: you can have strings as parms and then get those as the use targetsAnd generally you don't teleport people by using a target position (or at least I never heard of that method); you want to set SET_ORIGIN to the origin of the desired target_position. I can go into more detail later, I don't currently have access to the modding tools. Vartex likes this Link to comment
Vartex Posted November 17, 2015 Author Share Posted November 17, 2015 I moved the thread to the right section. Numerous things:When using an entity, you supply its targetname, not its script_targetname; the latter is for running scripts on entities, but if I remember correctly use takes the targetname.Just an optimization: you can have strings as parms and then get those as the use targetsAnd generally you don't teleport people by using a target position (or at least I never heard of that method); you want to set SET_ORIGIN to the origin of the desired target_position. I can go into more detail later, I don't currently have access to the modding tools. Thanks for your help, although for some reason I can't seem to manage to teleport the player using SET_ORIGIN. I can work with SET_ANGLE without any problem, but SET_ORIGIN just won't teleport the player. Any idea what's wrong?The syntax would be set ( /*@SET_TYPES*/ "SET_ORIGIN", < -584.000 -168.000 80.000 > ); Link to comment
Solution mrwonko Posted November 17, 2015 Solution Share Posted November 17, 2015 I've certainly successfully used SET_ORIGIN in singleplayer before... looked like this: set ( /*@SET_TYPES*/ "SET_ORIGIN", $tag( "cin1_cam1", ORIGIN)$ );Icarus also provides some other ways of setting the origin; I found these: set ( /*@SET_TYPES*/ "SET_ORIGIN", $tag( "my_ref_tag", ORIGIN)$ ); set ( /*@SET_TYPES*/ "SET_TELEPORT_DEST", $tag( "my_ref_tag", ORIGIN)$ ); set ( /*@SET_TYPES*/ "SET_COPY_ORIGIN", "my_target_position" );You could also try using a target_teleport. Are you doing this in MP or SP? I may be able to put together an example map. Vartex and Asgarath83 like this Link to comment
Vartex Posted November 17, 2015 Author Share Posted November 17, 2015 I've certainly successfully used SET_ORIGIN in singleplayer before... looked like this: set ( /*@SET_TYPES*/ "SET_ORIGIN", $tag( "cin1_cam1", ORIGIN)$ );Icarus also provides some other ways of setting the origin; I found these: set ( /*@SET_TYPES*/ "SET_ORIGIN", $tag( "my_ref_tag", ORIGIN)$ ); set ( /*@SET_TYPES*/ "SET_TELEPORT_DEST", $tag( "my_ref_tag", ORIGIN)$ ); set ( /*@SET_TYPES*/ "SET_COPY_ORIGIN", "my_target_position" );You could also try using a target_teleport. Are you doing this in MP or SP? I may be able to put together an example map. Thank you again. And I am working on MP map. I would really appreciate if you could create an example map for me ^^ EDIT: target_teleport seems to be only working option in MP. I managed to get the script working the way I wanted, you don't need to create the example map for me (unless you want to of couse). Thank you a lot for your help, I would be figuring this out for ages if it weren't for you, really appreciate it. Link to comment
mrwonko Posted November 17, 2015 Share Posted November 17, 2015 It appears SET_ORIGIN and SET_TELEPORT_DEST don't work in MP; I've had success with SET_COPY_ORIGIN and using a target_teleporter though. Here's my test map. Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now