ok but when is use level?

Have questions about CoD/UO mapping that aren't covered in the tutorials section? Post here!

Moderator: Core Staff

Post Reply
thader2005
CJ Wannabe
CJ Wannabe
Posts: 12
Joined: May 24th, 2008, 9:31 am

Difference between level thread and level

Post by thader2005 » May 24th, 2008, 9:53 am

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. :lol:

User avatar
Nightmare
Core Staff
Core Staff
Posts: 2688
Joined: January 12th, 2006, 10:09 pm
Contact:

Re: Difference between level thread and level

Post by Nightmare » May 24th, 2008, 8:54 pm

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.
Coding is Poetry. Mapping is Art.
"Cause im the sexiest mapper ever...except for nm, that sexy man" - Soviet

-=[CoDJumper.com Movies]=-
[Ambush] || [Backlot] || [Bloc] || [Bog] || [Broadcast] || [Chinatown] || [Countdown]
[Crash] || [Creek] || [Crossfire] || [District] || [Downpour] || [Killhouse] || [Overgrown]
[Pipeline] || [Shipment & Wetwork] || [Showdown] || [Strike] || [Vacant]

thader2005
CJ Wannabe
CJ Wannabe
Posts: 12
Joined: May 24th, 2008, 9:31 am

ok but when is use level?

Post by thader2005 » May 24th, 2008, 9:36 pm

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.

User avatar
Nightmare
Core Staff
Core Staff
Posts: 2688
Joined: January 12th, 2006, 10:09 pm
Contact:

Re: ok but when is use level?

Post by Nightmare » May 24th, 2008, 10:33 pm

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.
Coding is Poetry. Mapping is Art.
"Cause im the sexiest mapper ever...except for nm, that sexy man" - Soviet

-=[CoDJumper.com Movies]=-
[Ambush] || [Backlot] || [Bloc] || [Bog] || [Broadcast] || [Chinatown] || [Countdown]
[Crash] || [Creek] || [Crossfire] || [District] || [Downpour] || [Killhouse] || [Overgrown]
[Pipeline] || [Shipment & Wetwork] || [Showdown] || [Strike] || [Vacant]

User avatar
Drofder2004
Core Staff
Core Staff
Posts: 13313
Joined: April 13th, 2005, 8:22 pm
Location: UK, London

Re: ok but when is use level?

Post by Drofder2004 » May 25th, 2008, 3:28 pm

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.
Image
Virgin Media 20Mb Broadband:
"Perfect for families going online at the same time, downloading movies, online gaming and more."
Borked internet since: 22-07-2010

thader2005
CJ Wannabe
CJ Wannabe
Posts: 12
Joined: May 24th, 2008, 9:31 am

Sorry but i dont understand

Post by thader2005 » May 25th, 2008, 4:34 pm

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. :oops:

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

Post Reply

Who is online

Users browsing this forum: No registered users and 22 guests