UGX-Mods

Call of Duty: Black Ops 3 => Help Desk => Scripting => Topic started by: GrantArctix on November 26, 2016, 04:10:56 pm

Title: Shadows of Evil Portals
Post by: GrantArctix on November 26, 2016, 04:10:56 pm
I was wondering if anyone had or could create a script that acts as a portal like in the map Shadows of Evil. Just a simple portal would be nice too. If the player touches it they get transported to another location. If any one could help it would be greatly appreciated  :)
Title: Re: Shadows of Evil Portals
Post by: shinged on November 26, 2016, 08:23:42 pm
I was wondering if anyone had or could create a script that acts as a portal like in the map Shadows of Evil. Just a simple portal would be nice too. If the player touches it they get transported to another location. If any one could help it would be greatly appreciated  :)

Here
Code Snippet
Plaintext
function player_teleporter_init()
{
player_tp = GetEntArray( "teleport_player", "targetname" );
for( i = 0; i < player_tp.size; i++ )
{
player_tp[i] thread player_teleport();
}
}

function player_teleport()
{
destination = GetEnt( self.target, "targetname" );
while(1)
{
self waittill( "trigger", player );
player SetOrigin( destination.origin );
player SetPlayerAngles( destination.angles );
}
}

Create a trigger radius or trigger multiple then give it the KVP "teleport_player" "targetname". Now create a script origin, set its client KVP to server, and deselect it. Now select your trigger first, then your script_origin and hit w. Now you can select both and copy them as many times as you want. Changing the angle of the origin will change the player angle after tp'ing.
Title: Re: Shadows of Evil Portals
Post by: GrantArctix on November 26, 2016, 08:48:24 pm
Here
Code Snippet
Plaintext
function player_teleporter_init()
{
player_tp = GetEntArray( "teleport_player", "targetname" );
for( i = 0; i < player_tp.size; i++ )
{
player_tp[i] thread player_teleport();
}
}

function player_teleport()
{
destination = GetEnt( self.target, "targetname" );
while(1)
{
self waittill( "trigger", player );
player SetOrigin( destination.origin );
player SetPlayerAngles( destination.angles );
}
}

Create a trigger radius or trigger multiple then give it the KVP "teleport_player" "targetname". Now create a script origin, set its client KVP to server, and deselect it. Now select your trigger first, then your script_origin and hit w. Now you can select both and copy them as many times as you want. Changing the angle of the origin will change the player angle after tp'ing.

Thank you very much! Also I enjoyed your minecraft map it was really well made :D
Title: Re: Shadows of Evil Portals
Post by: Wolfplayer on November 27, 2016, 10:19:15 am
First of all, thank you for this script. But it seems I am doing something wrong.
Maybe I am forgeting something but this is my steps:

1. Paste your script in the bottom of my gsc file.
2. Create trigger_multiple or trigger_radius.
3. Create KVP(for trigger) named "teleport_player" to "targetname" value.
4. Create "script_origin".
5. Set KVP(for script_origin) named "client_server" to "ServerSide" value.
6. Select trigger, then select script and link them using W key.

After this I am trying to walk through my trigger, and nothing happens. I did something wrong?
Sorry for being stupid, but I am rather new to this whole scripting thing. :-\
Title: Re: Shadows of Evil Portals
Post by: reckfullies on November 28, 2016, 06:59:32 am
First of all, thank you for this script. But it seems I am doing something wrong.
Maybe I am forgeting something but this is my steps:

1. Paste your script in the bottom of my gsc file.
2. Create trigger_multiple or trigger_radius.
3. Create KVP(for trigger) named "teleport_player" to "targetname" value.
4. Create "script_origin".
5. Set KVP(for script_origin) named "client_server" to "ServerSide" value.
6. Select trigger, then select script and link them using W key.

After this I am trying to walk through my trigger, and nothing happens. I did something wrong?
Sorry for being stupid, but I am rather new to this whole scripting thing. :-\

Make sure you are calling the init script in your main function:
Code Snippet
Plaintext
function mainorwhateveritscalled()
{
    thread player_teleporter_init();
}
Title: Re: Shadows of Evil Portals
Post by: IceGrenade on December 07, 2016, 02:56:58 am
Just released this dude... to add fx to shadows style portals :D