Script problem!


(HotShot) #1

Im haveing a little trouble with my script, ive tried to sort it all day but had no luck yet, maybe a fresh pair of eyes can see whats wrong.
The script can be viewed Here

Alls I need to do is set it so the the game ends if the allies complete objective 1 & the axis complete objective 3!

If its any consolation heres the script and targetnames for objective 1 and 3

Objective 1
scriptname = axis controls
targetname = allied_obj_01

Objective 3
scriptname = allied_radios
targetname = axis_obj_01

The reaosn I assume its a script error is that the game will end when all 4 objectives have been completed. :???:

Hope someone can help, thnx!


(Hewster) #2

Hi HotShot, long time no see :slight_smile:

Firstly, the comments you have added should have “//” not “-”
second, since both sides can win from an objective you need 2 “checkgames”

try pasting this into your script:

	trigger objective_1
	{
		// Set objective1 status: 0 == AXIS, 1 == ALLIED
		wm_set_objective_status 1 1
		accum 1 set 1
		wm_announce "The Allies have destroyed the Axis controls!"
		trigger game_manager checkgame1
}

	trigger objective_2 
	{
		// Set objective2 status : 0 == AXIS, 1 == ALLIED
		wm_set_objective_status 2 1
		wm_announce "The Allies have blown the Axis Central Bridge"
}
		
	trigger objective_3
	{
		// Set objective3 status : 0 == AXIS, 1 == ALLIED
		wm_set_objective_status 3 0
		accum 1 set 1
		wm_announce "The Axis have destroyed the Allied Radios!"
		trigger game_manager checkgame2
}

	trigger objective_4
	{
		// Set objective4 status : 0 == AXIS, 1 == ALLIED
		wm_set_objective_status 4 0
		wm_announce "The Axis have blown the Allied Central Bridge"
}
	
	trigger checkgame1
	{
		accum 1 abort_if_not_equal 1

		// Set the round winner:  0 == AXIS, 1 == ALLIED
		wm_setwinner 1
		wait 1500
		wm_endround
	}

	trigger checkgame2
	{
		accum 1 abort_if_not_equal 1

		// Set the round winner:  0 == AXIS, 1 == ALLIED
		wm_setwinner 0
		wait 1500
		wm_endround
	}
}

no need for accum 2,3 & 4, we just use accum 1 to see if anyone has
won the round, and use the separate checkgames to see who.

Hewster


(HotShot) #3

lol thnx m8, dunno when ya posted this but I sussed it out when I got home from work, posted my answer on the tram forums. Shame these forums didnt email me that someone had replied, may have saved me racking :banghead: my brain to figure it out lol. All worth it though, I managed to figure it out by taking a look at the depot script, only rembered today that it had 2 destructable objectives for each side.

Thnx for ya help though :smiley:
Hows it goin anyway? You working on the Degeneration mod with Tunn?
Or you gone onto E.T like alot of others lol, I still prefer rtcw, more action :rocker:


(Hewster) #4

thinking about it, there is no reason why you cannot set the winner &
endround in the respective objectives, since once either of these
objectives are done it will always be end of game ?

Hewster


(HotShot) #5

lol weird eh? I don’t care its srted now lol, means I don’t gotta scripts for awhile now, “phew” Scripting is not my fav part of mapping!