Page 1 of 1
Difference between level thread and level
Posted: May 24th, 2008, 9:53 am
by thader2005
Hi
I have a doubt with
"level thread" and "
level".
for example:
main()
{
.......
level thread lookobject();
//
what kind of difference there is if I write thread lookobject()
}
lookobject()
{
..........
}
can anybody explain the use of level? thanks for all and congratulation for this web.

Re: Difference between level thread and level
Posted: May 24th, 2008, 8:54 pm
by Nightmare
OK, so there are different parts that you can use.
I am not sure where you got that code from, but I suggest you don't use it.
when you put an object in front of a function (user,self,other) then the function will basically do anything with that player
Ex: self suicide();
What this will do is go to another function which will kill the player or whatever else was initialized as self.
Now thread basically tells the game to run the function and keep on going as well (aka multi-threading).
If you simply had: moveobject();
if would wait until that function is done, then keep on going in the original function that it started in.
Hope this makes sense, if you have any other questions, just ask.
ok but when is use level?
Posted: May 24th, 2008, 9:36 pm
by thader2005
Thanks for your explanation. But I see code for example.
level thread maps\mp\_tankdrive_gmi::main();
I know that it is necessary for running the tanks, but if i dont push level and only write
thread maps\mp\_tankdrive_gmi::main();
then does it run?
what is the mean of level? what for is it use?
sorry there is more questions but I have an affair.
Another question, can you explain how use radiusDamage. I read and see differents codes but it is running well. I know that the parameters are as follows:
origin.- the point where is 0,0,0 of sphere.
range.- radius of sphere or range
MaxDamage:- I think max damage in 0,0,0
MInDamage.- I think min damage at the end radius of sphere.
I use for example:
radiusDamage (mortar[0].origin, 7000,100,20);
But near (0,0,0) the player no receive any damage. And there is an interval near 440 of distance between player and origin begins damage of player. I dont understand radiusDamage can you help me?
thanks for all.
Re: ok but when is use level?
Posted: May 24th, 2008, 10:33 pm
by Nightmare
level means that it will only work with that level that it is on.
For your radiusDamage;
Do you have an array called mortar? If not, then just use the player or who ever you defined to be damaged.
By adding .origin to the end of a entity declaration, you are telling the game to go to the center of that entity and doing whatever command you gave it there.
so if you say
radiusDamage (self.origin, 7000,100,20);
Then the player will be the center of the radiusDamage function and will be dealt with the most damage.
Hope this helps, if you have any more questions, just ask.
Re: ok but when is use level?
Posted: May 25th, 2008, 3:28 pm
by Drofder2004
Just to further explain "level". Level is used to detect things happening across the entire script, it is mostly used in vairables or "waittill" scripts..
For example, if I place the code:
Code: Select all
main()
{
thread runNotfiy();
level.waiting = true;
level waittill("continue");
...
}
runNotify()
{
wait 60;
level notify("continue");
level.waiting = false;
}
So, basically, it is a way for the script to communicate across the entire script and not just in the single function.
This is also similar to the way "self" works when applied to a player or entity, you can communicate across the entire script, but it will be linked to an entity and not the level.
Sorry but i dont understand
Posted: May 25th, 2008, 4:34 pm
by thader2005
First question:Every thing I wrote the other day, is it correct? if it is true then it is not running well. Can you give me one small example with map that you use radiusDamage please.
With regard to mortar[0] it is an array. there are two elements (script-model) where i place the explosion effect and it produces damage. For doing it i use radiusDamage but it isnt running correctly. i am confused sorry i need help
thanks for all