
Posts
3
Respect
Forum Rank
Fresh Corpse
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. |
![]() | Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum. |
and is there any doc or tutorial teaching how to interact a game object with functions? Like if I have a spawner and a trigger multiple in the game, how can I connect these two with a function? So I use the trigger, then the game calls the function, and the function makes the spawner spawn a zombie. Are there any examples like this?
//In your mapname.gsc, add this at the top with the others:
#using scripts\zm\my_custom_script;
//Then add this line in the main() function at the bottom:
level thread my_custom_script::initialize();
//Then in your mapname.zone file, add this line in there with the others:
scriptparsetree,scripts/zm/my_custom_script.gsc
//Now in usermaps/mapname/scripts/zm folder create a new text file, hit save as - my_custom_script.gsc
//So now you have a file you where you can experiment with scripts. In that file, paste all the "#using scripts\blahblah;" lines from your
//mapname.gsc file just to get you started. Some of the default functions you might use could need some of these scripts for the functions to work.
//So paste these at the top, you can figure it out. Just look at some of the other scripts.
//Then add the function you called earlier:
function initialize(){
level flag:wait_till("all_players_connected");
thread my_custom_function();
}
//If you want to press a button to activate the trigger, it needs to be a trigger_use, instead of a trigger_multiple
//Then add something like:
function my_custom_function(){
my_trig = GetEnt("custom_name", "targetname");
while(true){
my_trig waittill("trigger", player);
IPrintLnBold("Hello world");
//I'm not sure how to spawn a zombie, you'll have to look that up in the forums or make a help topic, sorry.
wait(1);
}
}