Page 2 of 2
Posted: Sat Aug 28, 2004 1:50 pm
by AfterDeath
Yup, I tried removing and everything still works. One problem I am having though (and can't figure it out) is this:
1- Map has two bombs.
2- Attacking team sets one bomb.
3- Everyone in attacking team dies.
4- Round continues til bomb blows up, even though the attacking team is already dead, and even though defending team still win even after that bomb blows up.
Here's the coding:
Code: Select all
win_bomb local.bombs:
for (local.i = 1; local.i <= local.bombs.size; local.i++) {
while (local.bombs[local.i].exploded != 1)
wait .1
}
if (level.planting_team == "axis")
teamwin axis
else
teamwin allies
end
Any thoughts?
Also, could I change the coding above to
teamwin level.planting_team instead?
And finally, is it possible to spawn a ladder? I've made ladders before through mapping, but I wonder if it is doable through scripting. Thanks!

Posted: Sat Aug 28, 2004 4:49 pm
by jv_map
AfterDeath wrote:1- Map has two bombs.
2- Attacking team sets one bomb.
3- Everyone in attacking team dies.
4- Round continues til bomb blows up, even though the attacking team is already dead, and even though defending team still win even after that bomb blows up.
It's a bug in mohaa... it happens on V2 too
Also, could I change the coding above to teamwin level.planting_team instead?
Yes.
And finally, is it possible to spawn a ladder? I've made ladders before through mapping, but I wonder if it is doable through scripting. Thanks!

Hmm I think scripted ladders don't work...
Posted: Sun Aug 29, 2004 7:15 am
by AfterDeath
jv_map wrote:AfterDeath wrote:1- Map has two bombs.
2- Attacking team sets one bomb.
3- Everyone in attacking team dies.
4- Round continues til bomb blows up, even though the attacking team is already dead, and even though defending team still win even after that bomb blows up.
It's a bug in mohaa... it happens on V2 too

Well, this happens EVERY time with my script. I remember very well on V2 how the round ends once the attacking team dies if there is one bomb (out of two) planted.
Also, could I change the coding above to teamwin level.planting_team instead?
Yes.
Really? Even though it's a string? ("axis"/"allies" instead of axis/allies)

Posted: Sun Aug 29, 2004 7:30 am
by jv_map
Have you set the level.targets_to_destroy variable somewhere at the beginning of your script (below level waittill spawn)?
Oh and allies and "allies" are both strings, doesn't matter if you put the " thingies around it.
Posted: Sun Aug 29, 2004 7:38 am
by AfterDeath
Have you set the level.targets_to_destroy variable somewhere at the beginning of your script (below level waittill spawn)?
That might be it. Why does it have to be AFTER level waittill spawn? Does it really matter?
Oh and allies and "allies" are both strings, doesn't matter if you put the " thingies around it.
Ok, cool. So is it that the scripting language automatically assumes that any text that does not match a variable must be a string?
Noob question: what does
spawn ScriptMaster do?
2nd noob question: how do I change, through scripting, the "Allow Join Time" (after which you can no longer join a team) ?
Posted: Sun Aug 29, 2004 8:27 am
by jv_map

you are a true question machine... np though
AfterDeath wrote:That might be it. Why does it have to be AFTER level waittill spawn? Does it really matter?
Yes I think it matters. For some weird reason, not all code above level waittill spawn gets executed after map restart
Ok, cool. So is it that the scripting language automatically assumes that any text that does not match a variable must be a string?
Yes..
Noob question: what does spawn ScriptMaster do?
It spawns a ScriptMaster object

... see g_allclasses.html for the definition of a ScriptMaster (g_dumpallclasses in console will generate this file).
2nd noob question: how do I change, through scripting, the "Allow Join Time" (after which you can no longer join a team) ?
setcvar g_allowjointime newvalue
Posted: Sun Aug 29, 2004 8:48 am
by AfterDeath

you are a true question machine... np though

Sorry

I just want to really learn the "language" instead of somewhat blindly copy/pasting.
For some weird reason, not all code above level waittill spawn gets executed after map restart

Ok. In general, what kind of coding would I place before/after waittill prespawn/spawn/roundstart ? I don't fully understand it.
BTW you can just point me to a link where this might be explained if you want.
- How do I access cvar's in the script? Example, if I wanted to print (iprintlnbold) the value of "g_gametype", how would I do it?
Thanks a lot for being the true answer machine JV_MAP

Posted: Sun Aug 29, 2004 9:08 am
by jv_map
Ok. In general, what kind of coding would I place before/after waittill prespawn/spawn/roundstart ? I don't fully understand it.
Well you can safely place anything below level waittill spawn, but things like the scoreboard text and pic are usually set before level waittill spawn... not sure why though

Place any objective code below level waittill roundstart so that it doesn't get executed until there are at least 2 players on the server.
- How do I access cvar's in the script? Example, if I wanted to print (iprintlnbold) the value of "g_gametype", how would I do it?
Code: Select all
local.value = getcvar g_gametype
iprintlnbold "g_gametype is: " local.value
or, you could do it directly:
Code: Select all
iprintlnbold "g_gametype is: " (getcvar g_gametype)
Be aware that getcvar always returns a string. Hence, you cannot do:
instead, use:
or:
Thanks a lot for being the true answer machine JV_MAP

Cheers

I didn't want to discourage you posting... keep the questions coming
