
Posts
72
Respect
12Add +1
Forum Rank
Rotting Walker
Primary Group
Member
Login Issues
Forgot password?Activate Issues
Account activation email not received? Wrong account activation email used?Other Problems?
Contact Support - Help Center Get help on the UGX Discord. Join it now!![]() | Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum. |
#using scripts\codescripts\struct;
#using scripts\zm\_zm_utility;
#using scripts\shared\flag_shared; //edit: You might need this too
function poi_test(){
level flag::wait_till("all_players_connected"); //edit
poi = struct::get("custom_poi", "targetname");
poi.trig = GetEnt(poi.target, "targetname");
poi.trig SetCursorHint("HINT_NOICON");
poi.trig SetHintString("Zombie exclusion volume");
// attract_dist, num_attractors, added_poi_value, start_turned_on, initial_attract_func, arrival_attract_func, poi_team
poi zm_utility::create_zombie_point_of_interest(100000, 99, 25, false);
// num_attract_dists, attract_dist
poi thread zm_utility::create_zombie_point_of_interest_attractor_positions(5, 100);
poi thread zm_utility::wait_for_attractor_positions_complete();
while(1){
poi.trig waittill("trigger", player);
if(player IsTouching(poi.trig)){
while(player IsTouching(poi.trig)){
poi.poi_active = true; //Turns point of interest on
wait(1);
}
}else
poi.poi_active = false; //Turns point of interest off
wait(1);
}
}
![]() | Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum. |
![]() | Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum. |
function init(){
//Edit - changed to struct::get_array not struct::get.
points = struct::get_array("exclusion_zone", "script_noteworthy");
foreach(point in points){
point.trig = GetEnt(point.target, "targetname");
point zm_utility::create_zombie_point_of_interest(100000, 99, 25, false);
point thread zm_utility::create_zombie_point_of_interest_attractor_positions(5, 100);
point thread zm_utility::wait_for_attractor_positions_complete();
point thread exclusion_zone();
}
}
function exclusion_zone(){
self.trig SetCursorHint("HINT_NOICON");
self.trig SetHintString("Exclusion Volume");
while(1){
self.trig waittill("trigger", player);
if(player IsTouching(self.trig)){
self.poi_active = true;
wait(1);
}else{
self.poi_active = false;
wait(1);
}
}
}
![]() | Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum. |
function test()
{
//Edit - adjusted for clarity
//First, define the array.
//Objects excluding script_struct's in radaint should use GetEntArray("key", "value"); and not struct::get_array
poi_array = struct::get_array("exclusion_zone", "targetname");
//Let's say you have 5 structs all named exclusion_zone
//When you do a foreach() loop, you can name the 'item' in the 'group' anything you want
//For example below, 'foreach(struct in poi_array)' you can call 'struct' anything, it's a temporary variable only defined
//within the for() loop.
//Like foreach(thing in things), or foreach(guy in things), but the 'things' has to be an array, that you
//define outside of and before the for() loop occurs. This can be used with any array, regardless of it's contents or application.
foreach(struct in poi_array)
{
//For each struct in the array "poi_array" defined above,
//execute this code 1 time for each struct:
struct.trig = GetEnt(struct.target, "targetname");
struct thread some_function();
}
}
function test2()
{
poi_array = struct::get_array("exclusion_zone", "targetname");
//Let's say you have 5 structs all named exclusion_zone
//This is the same as foreach, except in an array,
//the first object is index 0, then 1, 2 etc.
//And you loop through that array with 'i' which starts at 0,
//and loops until poi_array[4], which would be the 5th index.
for(i = 0; i < poi_array.size; i++)
{
IPrintLnBold("Hello I am struct #:"+i);
trigger = GetEnt(poi_array[i].target, "targetname");
poi_array[i].trig = trigger;
poi_array[i] thread some_function();
}
}
function some_function()
{
//Each poi struct becomes 'self' in this function.
//So self.trig is the same as poi_array[i].trig above or struct.trig in the first function
self.trig waittill("trigger", player);
IPrintLnBold("Hello my target is at"+self.trig.origin);
}
//Or, if you're really hungry, you could do
function get_donuts(){
a_dozen = GetEntArray("box_of_donuts", "script_food");
foreach(donut in a_dozen){
donut thread deep_fry();
while(donut.is_cooking){
donut waittill("minimum internal temperature reached");
donut.is_done_cooking = true;
}
donut thread dip_in_chocolate_glaze();
donut thread cover_in_sprinkles();
break; //For a taste test. :)
}
![]() | Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum. |
![]() | Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum. |
#using scripts\codescripts\struct;
#using scripts\shared\array_shared;
#using scripts\shared\callbacks_shared;
#using scripts\shared\clientfield_shared;
#using scripts\shared\compass;
#using scripts\shared\exploder_shared;
#using scripts\shared\flag_shared;
#using scripts\shared\laststand_shared;
#using scripts\shared\math_shared;
#using scripts\shared\scene_shared;
#using scripts\shared\util_shared;
//custom
//custom
#insert scripts\shared\shared.gsh;
#insert scripts\shared\version.gsh;
#insert scripts\zm\_zm_utility.gsh;
#using scripts\zm\_load;
#using scripts\zm\_zm;
#using scripts\zm\_zm_audio;
#using scripts\zm\_zm_powerups;
#using scripts\zm\_zm_utility;
#using scripts\zm\_zm_weapons;
#using scripts\zm\_zm_zonemgr;
#using scripts\shared\ai\zombie_utility;
//Perks
#using scripts\zm\_zm_pack_a_punch;
#using scripts\zm\_zm_pack_a_punch_util;
#using scripts\zm\_zm_perk_additionalprimaryweapon;
#using scripts\zm\_zm_perk_doubletap2;
#using scripts\zm\_zm_perk_deadshot;
#using scripts\zm\_zm_perk_juggernaut;
#using scripts\zm\_zm_perk_quick_revive;
#using scripts\zm\_zm_perk_sleight_of_hand;
#using scripts\zm\_zm_perk_staminup;
//Powerups
#using scripts\zm\_zm_powerup_double_points;
#using scripts\zm\_zm_powerup_carpenter;
#using scripts\zm\_zm_powerup_fire_sale;
#using scripts\zm\_zm_powerup_free_perk;
#using scripts\zm\_zm_powerup_full_ammo;
#using scripts\zm\_zm_powerup_insta_kill;
#using scripts\zm\_zm_powerup_nuke;
//#using scripts\zm\_zm_powerup_weapon_minigun;
//Traps
#using scripts\zm\_zm_trap_electric;
#using scripts\zm\zm_usermap;
//*****************************************************************************
// MAIN
//*****************************************************************************
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 thread poi_test();
level.pathdist_type = PATHDIST_ORIGINAL;
}
function usermap_test_zone_init()
{
level flag::init( "always_on" );
level flag::set( "always_on" );
}
function custom_add_weapons()
{
zm_weapons::load_weapon_spec_from_table("gamedata/weapons/zm/zm_levelcommon_weapons.csv", 1);
}
function poi_test(){
level flag::wait_till("all_players_connected"); //edit
poi = struct::get("custom_poi", "targetname");
poi.trig = GetEnt(poi.target, "targetname");
poi.trig SetCursorHint("HINT_NOICON");
poi.trig SetHintString("Zombie exclusion volume");
// attract_dist, num_attractors, added_poi_value, start_turned_on, initial_attract_func, arrival_attract_func, poi_team
poi zm_utility::create_zombie_point_of_interest(100000, 99, 25, false);
// num_attract_dists, attract_dist
poi thread zm_utility::create_zombie_point_of_interest_attractor_positions(5, 100);
poi thread zm_utility::wait_for_attractor_positions_complete();
while(1){
poi.trig waittill("trigger", player);
if(player IsTouching(poi.trig)){
while(player IsTouching(poi.trig)){
poi.poi_active = true;//Turns point of interest on
IPrintLnBold("Inside");
wait(1);
}
}else
poi.poi_active = false;//Turns point of interest off
IPrintLnBold("Outside!");
wait(1);
}
}
![]() | Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum. |
![]() | Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum. |
![]() | Has shown excellence and experience in the area of custom scripting in the UGX-Mods community. |
![]() Oil Rig Beta Access |
if(player IsTouching(poi.trig)){
while(player IsTouching(poi.trig)){
poi.poi_active = true;//Turns point of interest on
IPrintLnBold("Inside");
wait(1);
}
}else
poi.poi_active = false;//Turns point of interest off
IPrintLnBold("Outside!");
wait(1);