UGX-Mods Login

or login with an authentication provider below
Sign In with Google
Sign In with Twitter
Sign In with Discord
Sign In with Steam
Sign In with Facebook
Sign In with Twitch

[Tutorial] Simple Teleport Zombies Script

broken avatar :(
Created 7 years ago
by shinged
0 Members and 1 Guest are viewing this topic.
7,879 views
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 17 February 2014
Last active: 1 year ago
Posts
69
Respect
Forum Rank
Rotting Walker
Primary Group
Member
My Contact & Social Links
More
Personal Quote
What is broken can be reforged
Signature
Completed maps:
Kingdom Hearts - World at War Link
Minecraft - Black ops 3 Link

WIP:
~

×
shinged's Groups
shinged's Contact & Social LinksShingedvinny545TheShingedMatarra_
Hey guys, here is a simple script to add ways to teleport zombies in your map. So lets say you have a map with multiple zones and those zones are spaced apart, normally you would need to have a way for the zombies to get to the other like a hidden tunnel or something, this script is a good replacement for that. Here's a quick vid of it:


Radiant
The setup for this is very simple. The zombies need to be able to path to the area they are teleporting too. This can be done in a bunch of different creative ways such as using player clips or setting walls to non-colliding.
 - First create a trigger_multiple and give it this KVP "teleport_zombies" -  targetname.
 - Now create a script origin and place it halfway into the ground. Open the KVP's and set it to server. Now deselect everything, select the trigger first, then select the script_origin and hit W. What this will do is set the script_origin's targetname to an auto generated name so it can be copied without sharing targetnames.
 - Now you should see a line connecting the trigger to the origin. Double check to make sure its the trigger_multiple targeting script_origin and your good to go.
 - To add multiple teleporters just select the trigger and the origin and hit space. Check the kvp's to make sure the targetname on the origin is different from the targetname on the other origin and your done with radiant.

Here is an example of how i have mine setup, the clip is a clip_ai and not a player clip so only the zombies can cross that path.

Scripting
The scripting is extremely simple. Just open your mapname.gsc and copy this code.
Spoiler: click to open...
Code Snippet
Plaintext
/*
TELEPORT ZOMBIES ~ TELEPORT ZOMBIES ~ TELEPORT ZOMBIES ~ TELEPORT ZOMBIES ~ TELEPORT ZOMBIES ~ TELEPORT ZOMBIES ~ TELEPORT ZOMBIES ~ TELEPORT ZOMBIES ~
TELEPORT ZOMBIES ~ TELEPORT ZOMBIES ~ TELEPORT ZOMBIES ~ TELEPORT ZOMBIES ~ TELEPORT ZOMBIES ~ TELEPORT ZOMBIES ~ TELEPORT ZOMBIES ~ TELEPORT ZOMBIES ~
TELEPORT ZOMBIES ~ TELEPORT ZOMBIES ~ TELEPORT ZOMBIES ~ TELEPORT ZOMBIES ~ TELEPORT ZOMBIES ~ TELEPORT ZOMBIES ~ TELEPORT ZOMBIES ~ TELEPORT ZOMBIES ~
*/
function teleport_zombies_init()
{
teleport_trig = GetEntArray( "teleport_zombies", "targetname" );
for (i = 0; i < teleport_trig.size; i++)
{
teleport_trig[i] thread teleport_zombies();
}
}

function teleport_zombies()
{
teleport_destination = GetEnt( self.target, "targetname" );
while(1)
{
zombs = getaispeciesarray("axis","all");
for(k=0;k<zombs.size;k++)
{
if( zombs[k] IsTouching( self ) )
{
zombs[k] ForceTeleport( teleport_destination.origin );
}
}
wait(0.01);
}
}

 - Paste that code into the bottom of your mapname.gsc.
 - Now at the bottom of the main function paste this
Code Snippet
Plaintext
thread teleport_zombies_init();
- It should look something like this:
Code Snippet
Plaintext
function main()
{
zm_usermap::main();

level._zombie_custom_add_weapons =&custom_add_weapons;

//Setup the levels Zombie Zone Volumes
level.zones = [];
level.zone_manager_init_func =&usermap_test_zone_init;
init_zones[0] = "start_zone";
level thread zm_zonemgr::manage_zones( init_zones );

level.pathdist_type = PATHDIST_ORIGINAL;

thread teleport_zombies_init();
}

Now your done! Make sure when setting this up that the zombies are able to path to the destination otherwise they wont go into the portals. Also make sure to space the origin away from the portal a bit to avoid an infinite loop.

Let me know if you guys would like more simple scripting tutorial's like this.
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 12 September 2016
Last active: 3 years ago
Posts
306
Respect
Forum Rank
Perk Hacker
Primary Group
Member
My Contact & Social Links
More
×
reckfullies's Groups
reckfullies's Contact & Social LinksReckfulliesReckfullies
Hey guys, here is a simple script to add ways to teleport zombies in your map. So lets say you have a map with multiple zones and those zones are spaced apart, normally you would need to have a way for the zombies to get to the other like a hidden tunnel or something, this script is a good replacement for that. Here's a quick vid of it:
(Content removed from quote.)

Spoiler: click to open...
Radiant
The setup for this is very simple. The zombies need to be able to path to the area they are teleporting too. This can be done in a bunch of different creative ways such as using player clips or setting walls to non-colliding.
 - First create a trigger_multiple and give it this KVP "teleport_zombies" -  targetname.
 - Now create a script origin and place it halfway into the ground. Open the KVP's and set it to server. Now deselect everything, select the trigger first, then select the script_origin and hit W. What this will do is set the script_origin's targetname to an auto generated name so it can be copied without sharing targetnames.
 - Now you should see a line connecting the trigger to the origin. Double check to make sure its the trigger_multiple targeting script_origin and your good to go.
 - To add multiple teleporters just select the trigger and the origin and hit space. Check the kvp's to make sure the targetname on the origin is different from the targetname on the other origin and your done with radiant.

Here is an example of how i have mine setup, the clip is a clip_ai and not a player clip so only the zombies can cross that path.

Scripting
The scripting is extremely simple. Just open your mapname.gsc and copy this code.
Spoiler: click to open...
Code Snippet
Plaintext
/*
TELEPORT ZOMBIES ~ TELEPORT ZOMBIES ~ TELEPORT ZOMBIES ~ TELEPORT ZOMBIES ~ TELEPORT ZOMBIES ~ TELEPORT ZOMBIES ~ TELEPORT ZOMBIES ~ TELEPORT ZOMBIES ~
TELEPORT ZOMBIES ~ TELEPORT ZOMBIES ~ TELEPORT ZOMBIES ~ TELEPORT ZOMBIES ~ TELEPORT ZOMBIES ~ TELEPORT ZOMBIES ~ TELEPORT ZOMBIES ~ TELEPORT ZOMBIES ~
TELEPORT ZOMBIES ~ TELEPORT ZOMBIES ~ TELEPORT ZOMBIES ~ TELEPORT ZOMBIES ~ TELEPORT ZOMBIES ~ TELEPORT ZOMBIES ~ TELEPORT ZOMBIES ~ TELEPORT ZOMBIES ~
*/
function teleport_zombies_init()
{
teleport_trig = GetEntArray( "teleport_zombies", "targetname" );
for (i = 0; i < teleport_trig.size; i++)
{
teleport_trig[i] thread teleport_zombies();
}
}

function teleport_zombies()
{
teleport_destination = GetEnt( self.target, "targetname" );
while(1)
{
zombs = getaispeciesarray("axis","all");
for(k=0;k<zombs.size;k++)
{
if( zombs[k] IsTouching( self ) )
{
zombs[k] ForceTeleport( teleport_destination.origin );
}
}
wait(0.01);
}
}

 - Paste that code into the bottom of your mapname.gsc.
 - Now at the bottom of the main function paste this
Code Snippet
Plaintext
thread teleport_zombies_init();
- It should look something like this:
Code Snippet
Plaintext
function main()
{
zm_usermap::main();

level._zombie_custom_add_weapons =&custom_add_weapons;

//Setup the levels Zombie Zone Volumes
level.zones = [];
level.zone_manager_init_func =&usermap_test_zone_init;
init_zones[0] = "start_zone";
level thread zm_zonemgr::manage_zones( init_zones );

level.pathdist_type = PATHDIST_ORIGINAL;

thread teleport_zombies_init();
}

Now your done! Make sure when setting this up that the zombies are able to path to the destination otherwise they wont go into the portals. Also make sure to space the origin away from the portal a bit to avoid an infinite loop.

Let me know if you guys would like more simple scripting tutorial's like this.

Nice tutorial, this could be used in all sorts of ways. A cool thing anyone using this could also do is just add some fx to them when they teleport to make it seem like they aren't just appearing.
Last Edit: November 15, 2016, 01:15:59 am by reckfullies
broken avatar :(
×
broken avatar :(
Location: de
Date Registered: 4 November 2016
Last active: 7 years ago
Posts
11
Respect
Forum Rank
Legless Crawler
Primary Group
Member
×
cronex's Groups
cronex's Contact & Social Links
Yeah cool TUT :)
Now my question, how can i do this teleport with walls at all 4 sides, like a room ?
the zombies wont go into the portals ?

thanks man
broken avatar :(
×
broken avatar :(
Location: gbEurasian Plate, The Crust, Earth, The Solar System, The Milky Way
Date Registered: 4 November 2014
Last active: 11 days ago
Posts
181
Respect
Forum Rank
Pack-a-Puncher
Primary Group
Donator ♥
My Groups
More
My Contact & Social Links
More
Personal Quote
Mod Tools Tutorial Creator YouTube.com/IceGrenade
Signature
YouTuber Call of Duty Mod Tools Tutorial Creator on YouTube.com/IceGrenade
×
IceGrenade's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Yeah cool TUT :)
Now my question, how can i do this teleport with walls at all 4 sides, like a room ?
the zombies wont go into the portals ?

thanks man

Set the wall to non-collidable... then put a player clip over the wall... aka it will block players... but allow zombs to path. ;)

Double Post Merge: December 03, 2016, 04:12:07 pm
Also, epic stuff OP... I am excited to try it out :D
Last Edit: December 03, 2016, 04:12:07 pm by josh1600
broken avatar :(
×
broken avatar :(
Location: de
Date Registered: 15 April 2014
Last active: 7 years ago
Posts
1
Respect
Forum Rank
Fresh Corpse
Primary Group
Member
×
spainking's Groups
spainking's Contact & Social Links
Hello, Nice Tut! It works very nice but i have a question, how can i make that the zombies only teleport if i am in my 4th zone?
Thx
broken avatar :(
×
broken avatar :(
Location: fr
Date Registered: 26 August 2016
Last active: 4 years ago
Posts
2
Respect
Forum Rank
Fresh Corpse
Primary Group
Member
×
FlowMaker's Groups
FlowMaker's Contact & Social Links
Hello, can anyone help me?
I did everything that was said in the tutorial but it did not work could you solve the problem?

https://www.noelshack.com/2017-04-1485349656-1.png
https://www.noelshack.com/2017-04-1485349667-2.png
https://www.noelshack.com/2017-04-1485349667-capture.png

 
Loading ...