depends on how you called/threaded this function, but self is not the player prob?
Code Snippet
Plaintext
function jug_tele(player) { player SetOrigin(GetEnt("jug_tele","targetname").origin); IPrintLn("bonka"); wait(30); player SetOrigin(GetEnt("bar_tele","targetname").origin); level.jug_tele--; }
if (player laststand::player_is_in_laststand()) { break; } else { if(level.shoot_juggernog == 0) { IPrintLn("It's not unlocked yet ya snort snort"); } else { playfx(level._effect["powerup_grabbed"] ,GetEnt("perkmod_jug","targetname").origin); level.jug_tele++; thread jug_tele(); player playsound("Chinese_1");
break; }
} } }
I'm pretty sure that since bonka is shown, the function is being called correctly. I feel its the SetOrigins themselves or the entities I have in radiant. I gave a script struct the jug_tele targetname and another script struct bar_tele.
if (player laststand::player_is_in_laststand()) { break; } else { if(level.shoot_juggernog == 0) { IPrintLn("It's not unlocked yet ya snort snort"); } else { playfx(level._effect["powerup_grabbed"] ,GetEnt("perkmod_jug","targetname").origin); level.jug_tele++; thread jug_tele(); player playsound("Chinese_1");
break; }
} } }
I'm pretty sure that since bonka is shown, the function is being called correctly. I feel its the SetOrigins themselves or the entities I have in radiant. I gave a script struct the jug_tele targetname and another script struct bar_tele.
In my portal script i made a while back I use SetOrigin and it works fine, if you want a look at my function heres a screenshot:
Using player instead of self would also be the right thing to do.
EDIT: Instead of doing
Code Snippet
Plaintext
thread jug_tele();
do
Code Snippet
Plaintext
thread jug_tele(player);
Last Edit: November 04, 2016, 05:07:58 am by reckfullies
i used thread jug_tele(player);, but it still does not work. I thought that maybe changing up the function a bit would work:
Code Snippet
Plaintext
function juggers(player) { jugport = GetEnt("jug_tele","targetname"); barport = GetEnt("bar_tele","targetname");
player SetOrigin(jugport.origin); IPrintLn("bonka"); wait(30); player SetOrigin(barport.origin); level.jug_tele--;
}
still, nothing.
Just in case, here is what i put in radiant. The trigger_damage is targeting that struct with its targetname as jug_tele. The other targeted struct has the targetname bar_tele.
i used thread jug_tele(player);, but it still does not work. I thought that maybe changing up the function a bit would work:
Code Snippet
Plaintext
function juggers(player) { jugport = GetEnt("jug_tele","targetname"); barport = GetEnt("bar_tele","targetname");
player SetOrigin(jugport.origin); IPrintLn("bonka"); wait(30); player SetOrigin(barport.origin); level.jug_tele--;
}
still, nothing.
Just in case, here is what i put in radiant. The trigger_damage is targeting that struct with its targetname as jug_tele. The other targeted struct has the targetname bar_tele.
hmm, there has been an interesting development. Instead of using a script_struct, I used a script_model as the target. For some reason, it worked and I was teleported. I'll just use models instead of the structs now.
The teleporting script now works, but I have a question about activating the zone that contains the teleporter's target. I added the script_flag kvp to the trigger like you would on doors, but didn't work and i died. How can I go about this in script?
hmm, there has been an interesting development. Instead of using a script_struct, I used a script_model as the target. For some reason, it worked and I was teleported. I'll just use models instead of the structs now.
The teleporting script now works, but I have a question about activating the zone that contains the teleporter's target. I added the script_flag kvp to the trigger like you would on doors, but didn't work and i died. How can I go about this in script?
The thing about script_flag is, its just an empty kvp without a script. The only reason it activates zones for doors is because inside the door script it sees that it has that kvp and activates the specified zone inside the script.
You would just need to find the code that does that and apply it in your script somehow.
Look around inside _zm_blockers.gsc and if you can't find anything I'm sure someone would help you.
EDIT: There is a function inside _zm_zonemgr.gsc that allows you to activate a zone, I haven't tried this so don't take my word for it but here is how I would assume you would use it:
Code Snippet
Plaintext
#using scripts\zm\_zm_zonemgr; // Must include this script so that you can use it's functions!
function somefunctionname() // This would be your function you are already using. { zm_zonemgr::zone_init(<zone_name>, <zone_tag>); // Change <zone_name> to the targetname of your zone eg: "start_zone". I don't know what zone_tag does but I would assume it isn't required. }
Last Edit: November 04, 2016, 11:44:06 am by reckfullies