UGX-Mods

Call of Duty 5: World at War => Help Desk => Scripting => Topic started by: DeletedUser on August 15, 2013, 04:30:16 pm

Title: Teleporter not working
Post by: DeletedUser on August 15, 2013, 04:30:16 pm
So with help of sajeone i made a teleporter which teleports the player for free and the only thing it doesnt do is setting player position (basically setorigin doesnt want to work)
Script: http://pastebin.com/vhV2rk0Z (http://pastebin.com/vhV2rk0Z)
Code Snippet
Plaintext
teleporter1_think()
{
teleportUse = getEnt("teleport1_trigger", "targetname");
teleportMultiple = getEnt("teleport1_multiple","targetname");
teleportTarget = getEntArray("teleporter1_targetspawn","targetname");
teleportUse setHintString("Press &&1 to teleport");
while(1)
{
teleportUse waittill("trigger");
players = get_players();
for(i=0;i<players.size;i++)
{
if(players[i] IsTouching(teleportMultiple)){
players[i] setOrigin(teleportTarget[i].origin);
players[i] ShellShock("electrocution", 1, true);
}
}
earthquake( 1, 2, teleportTarget[0], 1000);
SetTimescale(0.1);
wait(1);
SetTimescale(1);
}
}
Title: Re: Teleporter not working
Post by: treminaor on August 15, 2013, 06:24:23 pm
Does the shellshock part happen? If so, your teleportTarget origin is probably not defined. If the shellshock part doesn't happen either, then your isTouching check is not working, most likely because telepoyrtMultiple is undefined. Add some iPrintLn's and isDefined() if you have to for debugging.
Title: Re: Teleporter not working
Post by: greenlungs81 on August 15, 2013, 06:47:53 pm
y not just copy the ones out of the tutorial and make it look like u want
Title: Re: Teleporter not working
Post by: DeletedUser on August 15, 2013, 07:00:09 pm
Does the shellshock part happen? If so, your teleportTarget origin is probably not defined. If the shellshock part doesn't happen either, then your isTouching check is not working, most likely because telepoyrtMultiple is undefined. Add some iPrintLn's and isDefined() if you have to for debugging.
The shellshock part happen succesfully and im pretty sure that I properly targetnamed the script_structs.
Title: Re: Teleporter not working
Post by: treminaor on August 15, 2013, 07:04:13 pm
The shellshock part happen succesfully and im pretty sure that I properly targetnamed the script_structs.
You can't use getEntArray with structs. You use getStructArray.
Title: Re: Teleporter not working
Post by: DeletedUser on August 15, 2013, 07:07:21 pm
You can't use getEntArray with structs. You use getStructArray.
Renamed. Compiling the map right now. Ill let you know if it worked.

Post Merge: August 15, 2013, 08:13:42 pm
Worked! Thanks! My map is near finished!