Hey guys! Really appreciate you guys clarifying that for me. It makes a lot more sense now. If you don’t mine me bothering you with one more question, when is it best to use “level”, “player”, or just threading the next function without anything in front of “thread blah blah blah”?It's best to start first with "self" in all the methods but sometimes you need extra hands to make the job done.
If it goes about the player you need to get the player.
In cod waw you can do this:
Maybe you want to check if the player has a certain perk:
players = getplayers();
For all the players:
if (players hasperk("specialty_armorvest"))
Or you want to write functions for the player activating the trigger:
for (i = 0; i < players.size; i++)
if (players[i] hasperk("specialty_armorvest"))
// do stuff
Because of the "waittill" function the game will wait at that point until it's triggered.
But sometimes you want to do other things while waiting and that's where the "thread" comes in.
You should see it as a road way that splits into two directions.
Normally you can only take one of the paths so you have to ask a friend to walk the other path.
That's what a thread does. (I am not sure you are known to this so that's the reason I explain this)
The "level" is a great static global database (don't have a better name for this currently) that can be used in every script.
The problem is that if you change a property somewhere it will be changed in every script where you call "level".
I think you already see the point.
I use "level" to update the scoreboard for example all the points, deaths, kills revives ect.
I used it last time to let all the zombies know that the solo player is in last stand mode.
It show results that the zombies go to a point I marked with a struct on the map.
See "level" as a webpage you want to share with anyone.
If you change the styling and save it then everyone can see the changes.