Planes
Moderator: Moderators
- small_sumo
- Lieutenant General
- Posts: 953
- Joined: Mon Jul 01, 2002 4:17 pm
- Contact:
Planes
In this bomber script what does the planes++ mean?
flyby:
//***random flyby of plane
while(1)
{
wait .5
level.planes++
thread global/bomber.scr::bomb 4
thread global/bomber.scr::bomb 5
wait 10
thread global/bomber.scr::bomb 6
thread global/bomber.scr::bomb 7
wait (randomint(30) + 30)
}
end
flyby:
//***random flyby of plane
while(1)
{
wait .5
level.planes++
thread global/bomber.scr::bomb 4
thread global/bomber.scr::bomb 5
wait 10
thread global/bomber.scr::bomb 6
thread global/bomber.scr::bomb 7
wait (randomint(30) + 30)
}
end
level.planes is a variable. this variable can be refered to in any script because of the scope it is given. i.e. not local or group but level.
level.planes is not actually used in the script you show other than the level.planes++
this means to add 1 to the current value of level.planes
level.planes is not actually used in the script you show other than the level.planes++
this means to add 1 to the current value of level.planes
Code: Select all
level.planes = 0
level.planes++
//level.planes now has the value 1
level.planes++
//level.planes now has the value 2
level.planes--
//level.planes now has the value 1
[VS-UK]Capt.Parts[BnHQ]
planes
Using "level.planes++" is an easier way of doing this:
level.planes = (level.planes + 1)
But, you have to set its starting value before hand. It is probably used someplace else in the script or in the Global/bomber.scr to keep track of how many planes are flying around.
level.planes = (level.planes + 1)
But, you have to set its starting value before hand. It is probably used someplace else in the script or in the Global/bomber.scr to keep track of how many planes are flying around.
- small_sumo
- Lieutenant General
- Posts: 953
- Joined: Mon Jul 01, 2002 4:17 pm
- Contact:
-
Bjarne BZR
- Site Admin
- Posts: 3298
- Joined: Wed Feb 05, 2003 2:04 pm
- Location: Sweden
- Contact:
Most stuff in the scripting language can be read here: http://www.planetmedalofhonor.com/rjuka ... guage.html
yeah, but that really didnt explain it enough for me. for example, the elevators part really confused me. it just says, "instead of doing this, do this" but it really doesnt say why, or what each new part works, like why do you put local.an_elevator after going up, and how does it work? i wish there was a scripting resource that explianed everything very very thoroughly.
check out this website: http://www.reapers.org/nwn/reference/
its a major scripting resource for neverwinter nights. even if you dont play it, click some of the things on the left and see how they explain everything and give good examples and tutorials. i wish there was a lexicon like that for mohaa.
check out this website: http://www.reapers.org/nwn/reference/
its a major scripting resource for neverwinter nights. even if you dont play it, click some of the things on the left and see how they explain everything and give good examples and tutorials. i wish there was a lexicon like that for mohaa.
-
Bjarne BZR
- Site Admin
- Posts: 3298
- Joined: Wed Feb 05, 2003 2:04 pm
- Location: Sweden
- Contact:
yeah but all it gives is a smalll little description. it doesnt explain it very thorougly. it doesnt show a proper usage either like,
"$world farplane 2048"
it just says, farplane ( float farplanedistance)
when i was new to scripting, it took me awhile to figure out i had to put $world in front of it to make it work.
i have no idea how to use doBlocked with a vehicle, and i would expect that to be one of the simpler things to learn.
"$world farplane 2048"
it just says, farplane ( float farplanedistance)
when i was new to scripting, it took me awhile to figure out i had to put $world in front of it to make it work.
i have no idea how to use doBlocked with a vehicle, and i would expect that to be one of the simpler things to learn.



