script mover at end of map


(.Chris.) #1

hey again, iam trying to get a plane to take off after axis win the map, as they take documents and fuel to this plane, but after i won the map the plane just sits there doing nothing, i cant see why it isnt moving.
heres the script with only the relevant parts to it:


game_manager
{
	spawn
	{


		setautospawn "Forward Spawn"	1
                setautospawn "Island Entrance"  0
		// Game rules
		wm_axis_respawntime	20
		wm_allied_respawntime	10
		wm_number_of_objectives 5
		wm_set_round_timelimit	30

		wm_set_main_objective		1	0
		wm_set_main_objective		1	1

		wm_objective_status 1 1 0
		wm_objective_status 1 0 0
		wm_objective_status 2 1 0
		wm_objective_status 2 0 0
		wm_objective_status 3 1 0
		wm_objective_status 3 0 0
		wm_objective_status 4 1 0
		wm_objective_status 4 0 0
		wm_objective_status 5 1 0
		wm_objective_status 5 0 0
		wm_objective_status 6 1 0
		wm_objective_status 6 0 0




		wm_set_defending_team	1
		wm_setwinner	1

                accum 1 set 0
        }


trigger stolen_objective
	{
		accum 1 inc 1				
		trigger game_manager checkgame		
	}

trigger checkgame
	{
		accum 1 abort_if_not_equal 2
		wm_setwinner 0
		wait 1500
		wm_endround
                trigger plane move 
	}

}

// ============================================================================
// Fuel cans and documents
// ============================================================================


fuel_can
{
	spawn
	{
	}

	trigger stolen
	{

                wm_announce "The Axis have stolen the documents!"

      		wm_objective_status 3 1 2
		wm_objective_status 3 0 1		
		

	}

	trigger dropped
	{
	}

	trigger returned
	{
		
                wm_announce "The Allies have returned the fuel!" 

      		wm_objective_status 3 1 1
		wm_objective_status 3 0 2		
		
	}

	trigger captured
	{

                wm_announce "The Axis have refueled the plane!"


                trigger game_manager stolen_objective
	}
}

documents
{
	spawn
	{
	}

	trigger stolen
	{

                wm_announce "The Axis have stolen the documents!"

      		wm_objective_status 2 1 2
		wm_objective_status 2 0 1		
		
	}

	trigger dropped
	{
	}

	trigger returned
	{
	
                wm_announce "The Allies have returned the documents" 

      		wm_objective_status 2 1 1
		wm_objective_status 2 0 2	

	}

	trigger captured
	{

                wm_announce "The Axis have secured the documents!" 


                trigger game_manager stolen_objective
	}
}

objective_holder
{
   death
   {
      wm_objective_status 4 0 1
      wm_objective_status 4 1 2

      trigger game_manager stolen_objective

   }
}

// ============================================================================
// The Plane
// ============================================================================


plane
{
 spawn
 {
  wait 200
  accum 1 set 0 // startspline no -1 

 }

 trigger move
 {
  accum 1 inc 1 // next spline
  accum 1 trigger_if_equal 1 plane move_1
  accum 1 trigger_if_equal 2 plane move_2  
  accum 1 trigger_if_equal 3 plane move_3
  accum 1 trigger_if_equal 4 plane move_4
  accum 1 trigger_if_equal 5 plane move_5
  accum 1 trigger_if_equal 6 plane move_6
  accum 1 trigger_if_equal 7 plane move_7
 }

 trigger move_1
 {
  followpath 0 point1 200 wait
 }
  
 trigger move_2
 {
  followpath 0 point2 250 wait
 }

 trigger move_3
 {
  followpath 0 point3 300 wait
 }

 trigger move_4
 {
  followpath 0 point4 350 wait
 }

 trigger move_5
 {
  followpath 0 point5 400 wait
 }

 trigger move_6
 {
  followpath 0 point6 400 wait
 }

 trigger move_7
 {
  followpath 0 point7 400 wait
 }

}

sorry for allinement messed up after copy and paste

info about entities:
scriptmover(clipping)

KEY:scriptname VALUE:plane
KEY:model2 VALUE:models/turbopoint/me109/messerschmidt.ase
spawnflags: solid


(Loffy) #2

Im not sure, but it has to be that accum scripting within the plane-script-block.
Have you tried removing the accum 1-scripting, within the plane-script-block, and adding trigger plane move_X? (See code below.)


trigger checkgame 
   { 
      accum 1 abort_if_not_equal 2 
      wm_setwinner 0 
      wait 1500 
      wm_endround 
                trigger plane move_1  // New!
   } 

plane
{
 trigger move_1 
 { 
  followpath 0 point1 200 wait 
 trigger plane move_2 // New!
 } 
  
 trigger move_2 
 { 
  followpath 0 point2 250 wait 
 trigger plane move_3 // New!
 } 
etc...
}

EDIT: There are two planes taking off at the end in my map “goldeneye_bunker1”. Check out the script for some inspiration :slight_smile:
The planes will also take off IF an allied engineer walks near the helicopter (main objective).
Download that map here: http://www.acc.umu.se/~loffy/goldeneye_bunker1.htm


(nUllSkillZ) #3

There’s a plane taking off after securing docu’s in “sos_secret_weapon”.
So you could take a look at their script.


(Malverik) #4

exactly!

  1. you initialize accum 1 to 0. It should be 1 so the plane goes to the first waypoint after you call “move”
  2. you need to trigger “move” again at the end of each “move_x” (except the last one…)