Call of Duty: Black Ops III

Call of Duty: Black Ops III

Not enough ratings
[Scripting] Notify / Endon
By 🐑🧙
This is a simple guid on the basics of using notify and endon functions in Bo3 and other call of duties.
   
Award
Favorite
Favorited
Unfavorite
Notify
Notify is used to notify when something happens in a script. For example when a player spawns it notifies that the player has spawned. This can then be read by any function that is looking for the player spawned notify. Let's look at an example.

Function sendNotify() { level notify(“continue”); } Function readNotify() { Level wattill(“continue”); iPrintLn(“script continued”);//print text }

In this example the function readNotify() will not print the text unit the code in sendNotify() function has run.

Let's look at a more complex example:

Function counter() { Number = 0; while(1) { Number++; if(number == 5) { Level notify(“playSoundFx”); } Wait 1; } } Function sound() { Level waittill(“playSoundFx”); Ent playSoundOnTag(“sound1”, “tag”); }
In this example the function counter will count to 5. When it has counted to 5 it will send the notify. The function sound() will read this notify and play a sound.

A notify can be called on any entity. For example in this script a notify will be called on a player:

function onPlayerSpawned() { Self notify(“spawned_player”); } Function giveLoadout() { self waittill( "spawned_player" ); Self giveWeapon(getweapon("pistol_default")); }
In this script the notify is being called on ‘self’ which is a player. When the player has spawned it will notify that the player has spawned. This is then read by the giveLoadout() function and will then give the player a weapon.
Endon
Endon is used to stop a function from running. For example you might want to stop a function that has a loop in it. Endon is triggered by a notify. Here is an example:

Function stop() { Level notify(“stopLoop”); } Function looping() { Level endon(“stopLoop”); X = 1; while(1) { X++; Wait 1; } }
In this script the the function looping will keep add one to ‘X’ until the function stop() is run. As you can see the endon always goes at the start of a function.
Here is a more complex example:

Function trigger() { level endon("game_ended"); trigger = getent("trig_1", "targetname"); while(1) { trigger waittill("trigger", player); Player iPrintLn(“Finish”); } } Function gameEnd() { level endon("game_ended"); X = 1; while(1) { X++; if(x == 100) { Level notify(“game_ended”); } Wait 1; } }
In this example the function trigger will check if a trigger has been triggered by a player. But in the function gameEnd() the function trigger() will be stopped. In the example the function gameEnd() will also be stopped as well.

Endon can also be called on other entities such as player.
4 Comments
🐑🧙  [author] Feb 5, 2017 @ 9:26am 
GSC
BizzareSyrupDuck Feb 4, 2017 @ 12:52pm 
But what type of script is it, what lang?
🐑🧙  [author] Feb 4, 2017 @ 12:33pm 
Read the tutorial^
BizzareSyrupDuck Feb 4, 2017 @ 11:12am 
Uh, what is this for and how can I use it?