Several script questions
Moderator: Moderators
Several script questions
Hi guys.....been busy with my MP obj map and it's almost completed. I was trying to learn about the scripting part by looking over different scripts and i have a few questions i hope someone can shed some light on for me.
1. What is the purpose/importance of exec global/exploder.scr i have seen this placed in a few obj maps, but not all that i looked at. Is this used in conjunction with something?
2. exec global/ambient.scr? i am assuming this is for sound?
3. level.clockside? i assume this tells who is the defender of the bomb. I get Axis and Allies, but what do setting it to kills or draw do?
4. When setting script for explosions i noticed the following script
bomb1_exploded local.bomb1:
while (local.bomb1.exploded != 1)
wait .1
iprintlnbold_noloc "That's the Flak88 Destroyed"
//$spawn_axis2 disablespawn
//$spawn_axis3 enablespawn
The question i have is that i noticed that wait .1 was replaced with waitframe in some scripts i looked at. Are they the same? better to use one vs. the other?
Also the //$spawn_axis2 disablespawn
//$spawn_axis3 enablespawn
I noticed that when creators placed a second bomb the second script was changed to //$spawn_axis2 disablespawn
//$spawn_axis4 enablespawn
What are these lines for? What do they mean? And why the change in number from 3 on the first to 4 on the second?
5. Last i thought about using a flyby in my MP obj map. I have seen this done in MP no respawn maps like V2 rocket using the following scripts:
exec global/bomber.scr
//thread flyby
and
flyby:
//***random flyby of plane
wait 1.0
thread global/bomber.scr::bomb 4
thread global/bomber.scr::bomb 5
thread global/bomber.scr::bomb 6
thread global/bomber.scr::bomb 7
wait (randomint(180) + 60)
goto flyby
Can these same scripts be used if it is a respawn obj map like OMAHA BEACH.
Sorry for all the questions. Just don't know where else to turn.
Thx in advance.
1. What is the purpose/importance of exec global/exploder.scr i have seen this placed in a few obj maps, but not all that i looked at. Is this used in conjunction with something?
2. exec global/ambient.scr? i am assuming this is for sound?
3. level.clockside? i assume this tells who is the defender of the bomb. I get Axis and Allies, but what do setting it to kills or draw do?
4. When setting script for explosions i noticed the following script
bomb1_exploded local.bomb1:
while (local.bomb1.exploded != 1)
wait .1
iprintlnbold_noloc "That's the Flak88 Destroyed"
//$spawn_axis2 disablespawn
//$spawn_axis3 enablespawn
The question i have is that i noticed that wait .1 was replaced with waitframe in some scripts i looked at. Are they the same? better to use one vs. the other?
Also the //$spawn_axis2 disablespawn
//$spawn_axis3 enablespawn
I noticed that when creators placed a second bomb the second script was changed to //$spawn_axis2 disablespawn
//$spawn_axis4 enablespawn
What are these lines for? What do they mean? And why the change in number from 3 on the first to 4 on the second?
5. Last i thought about using a flyby in my MP obj map. I have seen this done in MP no respawn maps like V2 rocket using the following scripts:
exec global/bomber.scr
//thread flyby
and
flyby:
//***random flyby of plane
wait 1.0
thread global/bomber.scr::bomb 4
thread global/bomber.scr::bomb 5
thread global/bomber.scr::bomb 6
thread global/bomber.scr::bomb 7
wait (randomint(180) + 60)
goto flyby
Can these same scripts be used if it is a respawn obj map like OMAHA BEACH.
Sorry for all the questions. Just don't know where else to turn.
Thx in advance.
I'll give ya some quick answers that I feel good about, I'm sure the "pros" will be along soon enough to fill in the blanks...
1. the 'global/exploder' basically is a stock script that enables placed exploders/explosions like artillery shells and other 'placed or timed' bombs and events.
2. ties your map script to general game sounds loaded through another stock script. You also need to define your own .mus file that will include code for music, battle sounds, etc.
3. level.clockside tells the game which team in a MULTIPLAYER map is the team that can win IF they hold out until the round clock expires. i.e. Take the 'Hunt' or 'Omaha' maps. IF the Axis can have at least one player survive until the clock reaches 0:00 they can win even without killing all the Allies....as long as the artillery pieces aren't blown up.
4. I can't offer a good explanation of the 'wait .1' vs. 'waitframe' but I'd guess that 'waitframe' is actually comparable to 'wait 1.0'.
As for the '$spawn.... dis/en/able. You can set various triggers/scripted events to turn on or off different spawn locations for one or both sides. Omaha features this where the Allies initially spawn ONLY in the boats, but later under the right circumstances, they can spawn as far up as the shingle/trench line. Depends on what objectives are taken/controlled by who and/or what trigger is set up at what point. Kind of a reward system for pushing across a linear map. Wouldn't work in 'Southern France' style maps.
5. sets up a randomly timed 'flyby' and bombing by aircraft. For me, a real b**ch of a problem to get related sounds to work. You'll see this in the Berlin_TOW map...or a version of it. Getting all the entites and their info set is the challenge because IF you can do that, you can copy the script virtually word for word. A couple tutorials out there but you'd have to dig at various web sites to find them.
NEXT.....wait for JV, _Rox, Surgeon, or InnKeeper to correct me and fill in better details.
1. the 'global/exploder' basically is a stock script that enables placed exploders/explosions like artillery shells and other 'placed or timed' bombs and events.
2. ties your map script to general game sounds loaded through another stock script. You also need to define your own .mus file that will include code for music, battle sounds, etc.
3. level.clockside tells the game which team in a MULTIPLAYER map is the team that can win IF they hold out until the round clock expires. i.e. Take the 'Hunt' or 'Omaha' maps. IF the Axis can have at least one player survive until the clock reaches 0:00 they can win even without killing all the Allies....as long as the artillery pieces aren't blown up.
4. I can't offer a good explanation of the 'wait .1' vs. 'waitframe' but I'd guess that 'waitframe' is actually comparable to 'wait 1.0'.
As for the '$spawn.... dis/en/able. You can set various triggers/scripted events to turn on or off different spawn locations for one or both sides. Omaha features this where the Allies initially spawn ONLY in the boats, but later under the right circumstances, they can spawn as far up as the shingle/trench line. Depends on what objectives are taken/controlled by who and/or what trigger is set up at what point. Kind of a reward system for pushing across a linear map. Wouldn't work in 'Southern France' style maps.
5. sets up a randomly timed 'flyby' and bombing by aircraft. For me, a real b**ch of a problem to get related sounds to work. You'll see this in the Berlin_TOW map...or a version of it. Getting all the entites and their info set is the challenge because IF you can do that, you can copy the script virtually word for word. A couple tutorials out there but you'd have to dig at various web sites to find them.
NEXT.....wait for JV, _Rox, Surgeon, or InnKeeper to correct me and fill in better details.
Well you've explained almost everything very well Slyk
Only some remarks:
1. The global/exploder.scr script is used to blow up walls or models. If you haven't got any $exploder entities, this line won't do a thing, so miss it out completely.
4. Waitframe waits for one server frame, which generally takes 0.05 seconds. So, waitframe more or less equals wait 0.05 but is better, as it doesn't require any frame to time calculations. The difference is very small though. The developers could have used a larger value, e.g. wait 0.5.
The spawn enable / disable lines are commented out so they won't actually do a thing. Your explanation is right though
.
5. See global/bomber.scr for a small tutorial on plane fly-bys.
Only some remarks:
1. The global/exploder.scr script is used to blow up walls or models. If you haven't got any $exploder entities, this line won't do a thing, so miss it out completely.
4. Waitframe waits for one server frame, which generally takes 0.05 seconds. So, waitframe more or less equals wait 0.05 but is better, as it doesn't require any frame to time calculations. The difference is very small though. The developers could have used a larger value, e.g. wait 0.5.
The spawn enable / disable lines are commented out so they won't actually do a thing. Your explanation is right though
5. See global/bomber.scr for a small tutorial on plane fly-bys.
Gosh, Slyk and jv_map. Do you guys like have a moh scripting dictionary or do you have every peice of code written down/printed somewhere and then play the game and memorize what each code do? Or are you guys undercover EA programmers who try to take ideas and implement them into the new games.
Because well... dam you know almost everypiece of data there is to know in moh scripting i am a noob so please explain how you got all of this knowledge. Because i sure heck know that not everysingle part of the scr files have tut and line for line on what everything means.

Because well... dam you know almost everypiece of data there is to know in moh scripting i am a noob so please explain how you got all of this knowledge. Because i sure heck know that not everysingle part of the scr files have tut and line for line on what everything means.
Oh my God... I am SOOOOOooooo freakin' far from any wiz. Just a mildly adhd challenged dude who can really get into something that interests him...
Scripting guru is left to JV... I suck at it. Takes me hours of time to analyze anything. (JV read that I still can't make squat out of that random spawn thing
).
Thanks for the compliments though.. just trying to help out with my experiences. Like they say, if you can help just one...
Nah, that's too corny. Just share info, helps everybody.
Scripting guru is left to JV... I suck at it. Takes me hours of time to analyze anything. (JV read that I still can't make squat out of that random spawn thing
Thanks for the compliments though.. just trying to help out with my experiences. Like they say, if you can help just one...
Nah, that's too corny. Just share info, helps everybody.

