Reviving health on a script_mover, how?


(lispider) #1

Ok I have the following script for a test map so I can import the entities and such to a map im working on. There are probably better ways to do what i am doing but I could really use help getting the health to revive.


game_manager
{
	spawn
	{
		// Game rules
		wm_axis_respawntime	3
		wm_allied_respawntime	3
		wm_set_round_timelimit	60
		wm_setwinner -1

		// accums
		globalaccum 0 set 0		// what is the highest flag number taken
		globalaccum 1 set 0
		wait 150
	}
}


//Moving Target 1 Script
box
{
	trigger move
	{
		globalaccum 1 abort_if_greater_than 10
		globalaccum 1 inc 1
		gotomarker p1 200 wait
		gotomarker p2 200 wait
		trigger box move
	}
	death
	{
		trigger door1 open
		globalaccum 1 set 11
		alertentity t1
	}
}
//Door 1
door1
{
	trigger open
	{
		gotomarker d1 200 wait 5000
		gotomarker d2 200 wait
	}
}


// Reset Accum 1 to 0
reset1
{
	trigger ac0
	{
		globalaccum 1 set 0
	}
}

Ok so whats happening is even though the entity t1 which is the target box exists the map errors out and say Entity cannot be found. So I have targetted the scrip also asked many people and no solution.

What I am trying to do is this, a flying target comes into view then it has health set to 100 then when “death” occurs scripts are triggered that open a door and then stop its movement. What I am trying to do is have a trigger that resets the flying targets health that was previously 100. But I cannot seem to figure it out.

if anyone has time to view the map and script in full, http://teamlithium.com/testmap.zip

2Kb download so dont be scared and for those new to using script_movers feel free to look at this and steal what you like from it as its written from scratch.


(nUllSkillZ) #2

To the “entity not found” error:
I think you should add a:


spawn
{
     wait 100
}

block at the beginning of your entity script blocks.


(lispider) #3

that still doesnt help reset the health of the script_mover :frowning:


(lispider) #4

figured it out so far as what I wanted to do


game_manager
{
	spawn
	{
		// Game rules
		wm_axis_respawntime	3
		wm_allied_respawntime	3
		wm_set_round_timelimit	60
		wm_setwinner -1

		// accums
		globalaccum 0 set 0		// what is the highest flag number taken
		globalaccum 1 set 0
		wait 150
	}
}


//Moving Target 1 Script
box
{
	spawn
	{
		wait 100
	}
	trigger move
	{
		globalaccum 1 abort_if_greater_than 10
		globalaccum 1 inc 1
		gotomarker p1 200 wait
		gotomarker p2 200 wait
		trigger box move
	}
	death
	{
		trigger door1 open
	}
	trigger reborn
	{
		alertentity box
	}
}
//Door 1
door1
{
	spawn
	{
		wait 100
	}
	trigger open
	{
		gotomarker d1 200 wait 5000
		gotomarker d2 200 wait
		wait 100
	}
}


// Reset Accum 1 to 0
reset1
{
	spawn
	{
		wait 100
	}
	trigger ac0
	{
		globalaccum 1 set 0
		trigger box reborn
	}
}


(G0-Gerbil) #5

I don’t know the script functions off the top of my head but they should be in the LDR.
Look under the construction system - specifically I seem to recall they say how to do it for MG placements so they don’t get built into a damaged state.

So to repair - look in say fueldump script with the towers / mg placements.
To damage - look in venice with the AT gun.


(Malverik) #6

yep, its simply the “alertentity” that brings a script_mover back to life

you could also have done it directly in the trigger ac0


reset1 
{ 
   ...
   trigger ac0 
   { 
      globalaccum 1 set 0 
      alertentity box
   } 
} 

also when you do that it calls the “rebirth” trigger so if you need to do something when its reborn you do it here:


box
{
   ...
   rebirth  // script_mover back with full health
   {
   // do stuff
   }

   pain   // script_mover being damaged
   {
   // do stuff
   wm_announce  "The box is being attacked!!"
   }
}


(lispider) #7

oddly the alertentity only worked when inside the box script anytime I moved it outside like ur example it would not bring it back to life health wise…