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

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Messages - Wolfilms

Can you tell me how to allow the trigger to activate only when the tesla_gun fires at the trigger ?

You can check what gun they have using getCurrentWeapon() and if the current weapon is the tesla_gun, you can do whatever you want after that.
7 years ago
Some people get offended by this, but please know I mean no offense:

Here are some tips to clean up your code, make it more readable, and dynamic:

Code Snippet
Plaintext
function openDoor()
{
     level.door = GetEnt("door", "targetname");//I personally would pass the door, and not use a level var

     // level.trig1 = GetEnt("trigger1", "targetname");
     // level.trig2 = GetEnt("trigger2", "targetname");
     // level.trig3 = GetEnt("trigger3", "targetname");

     //instead of three level trigs above give them all the same targetname and do this
     trigs = GetEntArray("triggers","targetname");


     level.doorClip = GetEnt("door_clip", "targetname");//I personally would set the clip as the doors target and not use level var
     //need to disconnect paths on the door so zombies don't try to go through
     level.doorClip DisconnectPaths();//may not see this issue if no other way in that area

     level.buttonsNeeded = trigs.size;//set this to the number of trigs by using array size
     // level.buttonsPressed = 0;//we can comment this out and just use buttons needed and subtract

     // thread Trig1();
     // thread Trig2();
     // thread Trig3();

     //instead of threading the same function with a different name on each different trigger
     //you can thread on the array, or iterate the array and thread on each trigger

     //iterate method:
     foreach(trig in trigs)
     {
          trig thread Trig1();//I personally would pass the door, and not use a level var
     }

     //thread_all method:
     // array::thread_all(trigs, &Trig1);//this method requires adding #using scripts\shared\array_shared; to top

}

function Trig1()//I personally would pass the door, and not use a level var
{
     //you should set the hint here
     self SetCursorHint("HINT_NOICON");
     self SetHintString("Press [{+activate}] to...");

     // while(1)//no need for a while loop when you are breaking unconditionally
     // {
     self waittill("trigger", player);//self is the trigger, and player isn't used, so not really needed
     level.buttonsPressed--;//subtract so we can check < 0 later
     self Delete();//self delete
     CheckDoor();
     // break;
     // }
}
//no need for multiple functions that do the same function
// function Trig2()
// {
//      while(1)
//      {
//      level.trig2 waittill("trigger", player);
//      level.buttonsPressed++;
//      level.trig2 Delete();
//      CheckDoor();
//      break;
//      }
// }

// function Trig3()
// {
//      while(1)
//      {
//      level.trig3 waittill("trigger", player);
//      level.buttonsPressed++;
//      level.trig3 Delete();
//      CheckDoor();
//      break;
//      }
// }

function CheckDoor()//I personally would pass the door, and not use a level var
{
     // if(level.buttonsPressed >= level.buttonsNeeded)//check if >= instead of == just incase something bugs
     if(level.buttonsNeeded<=0)//changed this to check for less than 0 since now we will subtract
     {
          level.doorClip ConnectPaths();
          level.door Delete();
          level.doorClip Delete();
     //when you open a door, you'll need to connect the paths, which means you should disconnect the paths first
     }
}


Here is the code cleaned up. I would also set the doors as the target of the triggers and make some more tweaks, but this is cleaner and you can add as many triggers as you want this way: (sorry for any typos or errors, didn't test)
Code Snippet
Plaintext

function openDoor()
{
     trigs = GetEntArray("triggers","targetname");
     level.buttonsNeeded = trigs.size;

     door = GetEnt("door", "targetname");
     
     doorClip = GetEnt("door_clip", "targetname");//I personally would set the clip as the doors target and not use level var
     doorClip DisconnectPaths();

     foreach(trig in trigs)
     {
          trig thread Trig1(door, doorClip);
     }
}

function Trig1(door, doorClip)
{
     self SetCursorHint("HINT_NOICON");
     self SetHintString("Press [{+activate}] to...");

     self waittill("trigger", player);
     level.buttonsPressed--;
     self Delete();
     CheckDoor(door, doorClip);
}

function CheckDoor(door, doorClip)
{
     if(level.buttonsNeeded<=0)
     {
          doorClip ConnectPaths();
          door Delete();
          doorClip Delete();
     }
}


Could the problem be that you are setting buttonsNeeded to trigs.size, but later in the code you are subtracting buttonsPressed and not buttonsNeeded?
7 years ago
Can you link a video or screenshot of what your vehicle looks like in radiant and do the same for in game?
7 years ago
Quote
Also I believe in radiant there is an option on script_model and script_brushmodels to enable them as a moving platform. It's in the kvp's, I have only tested the function via script though so you'd have to test that.

I have tested this out by ticking the setting in radiant, and I have found that it works without having to need any code.
7 years ago
No, you will not get more assets from the DLC. I would also assume that most doors are models
7 years ago
Do you have the additional assets downloaded? If not, It is a very large download, but here are the steps to download it.

In steam find the Black ops 3 Mod Tools -> right click on the tools in steam -> click "properties" -> find the DLC tab and click it -> and install the additional assets
7 years ago
Like I said before it's probably a lot easier just to make the trig a trigger_use, I have it working fine this way. This is the exact script I'm using with only minor changes to take out some of my checks.

Code Snippet
Plaintext
//Put these three in your main() function at the bottom
level flag::wait_till("all_players_connected");
poi = poi_setup();
poi thread poi_test();

//These are the two functions I'm using
function poi_setup(){
poi = struct::get("custom_poi", "targetname");
poi.trig = GetEnt(poi.target, "targetname");
poi.trig SetCursorHint("HINT_NOICON");
poi.hint = "Press &&1 to distract zombies"; //Or whatever hint you want
poi.trig SetHintString(poi.hint);
poi.poi_active = false;
// 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();
return poi;
}

function poi_test(){
while(1){
self.trig waittill("trigger");
self.poi_active = true;
cooldown = 15; //Change to time desired - I'm using 15 for testing
while(1){
if(cooldown > 0){
cooldown--;
self.trig SetHintString("Cooling down in ["+cooldown+"]..."); //This updates the trig with time left
wait(1);
}else
break;
}
self.poi_active = false;
self.trig SetHintString(self.hint);
}
}


Also this is just a proof of concept script that I made, so you should think about a way to limit this so players can't just keep using it over and over again. The cooldown in the script really should be called "poi active time" or something like that, because cooldown makes more sense to be the time after the poi expires, and before it can be triggered again. You can use a simple wait(time) or some other check. Here's a short vid demonstrating how I'm using it with the script I provided you.

(Content removed from quote.)

Ok, thanks. I planned on making this just like a cool, hidden feature in my map so in no way do I intend to make it OP. Thanks everyone!
7 years ago
Ok thanks
7 years ago
doing this will break on co-op

everyone will be safe as long as one person is in the POI

Is it possible to have it so that every player in the game has to hit a trigger?
7 years ago
So all I did was take out the else statement, but nothing changed in the game. The zombies still always go to the POI even after I leave the trigger.
7 years ago
Ok, thanks guys! I’ll test it on Monday when I get home!
7 years ago
Code Snippet
Plaintext
#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);
}
}
Here are the images of radiant and the KVPs: http://imgur.com/a/Jps4t
7 years ago
Ok, so I just tested it. It works, but after I leave the trigger the zombies keep going to the script_struct. Any thoughts on why?
7 years ago
That is a great explanation. Thanks :)
7 years ago
Oh wow, great explanation. Thank you. But another question I have, that I've seen in other code, what does foreach() do and how do you use it?
7 years ago
Loading ...