script_mover troubleshooting...


(Digm) #1

I’ve read several tutorials, and I’ve gone over this a thousand times and can’t find the problem…

It’s frustrating me so much I spent the time to make a photo montage to display all my entries in the hopes someone here can help…

It’s meant to be a lift that goes from the main hangar area to an underground bunker area. Basically, nothing happens when I hit the button…

The brush that is meant to go up and down…

The trigger…

The origin and path_corner (with the lift hidden)… path_corner’s targetname is lift_up_point.

The destination path_corner…

and the relevant section of my script…

move_lift
{
	trigger move_lift_down
	{
		// call trigger to move lift down
		trigger lift move_to_basement
	}
		
	trigger move_lift_up
	{
	// call trigger to move lift up	
                trigger lift move_to_hangar
	}
}


// hangar lift function
lift
{
	
	trigger move_to_basement
	{
		gotomarker lift_down_point 32		
				
	}
	
	trigger move_to_hangar
	{
		gotomarker lift_up_point 32	
	}
	

}

I know it’s probably something incredibly stupid…


(hummer) #2

Make sure your origin is part of your mover.

Your trigger points to a target_script_trigger (orange box). Your target_script_trigger should have the targetname / scriptname move_lift and the a target of “go”. The target_script_trigger is what is calling the script, and it’s target is what get’s executed.

Then do this with your script:


move_lift 
{ 
   spawn
   {
      wait 100          // should set a wait for entities
      accum 1 set 0  // logic for up or down movement (1 = up, 0 = down)
   }
   trigger go
   {
      accum 1 trigger_if_equal 1 trigger move_lift_down // only trigger if accum = 1
      accum 1 trigger_if_equal 0 trigger move_lift_up // only trigger if accum = 0
   }
   move_lift_down 
   { 
      trigger lift move_to_basement    // calls the move to the basement
   } 
       
   trigger move_lift_up 
   {    
                trigger lift move_to_hangar // calls the move to the hangar
   } 
  
   trigger accum_1_on
   {
      accum 1 set 1 // sets accum to 1
   }
  
     trigger accum_1_off
   {
      accum 1 set 0 // sets accum to 0
   }

} 


// hangar lift function 
lift 
{ 
    spawn
   {
     wait 100
   }
   trigger move_to_basement 
   { 
      gotomarker lift_down_point 32 wait // wait until move is done...
      trigger move_lift accum_1_off //... before the changing accum to 0.
   } 
    
   trigger move_to_hangar 
   { 
      gotomarker lift_up_point 32  wait // wait until move is done...
      trigger move_lift accum_1_on  // ... before the changing accum to 0.
   } 
    

}

Keep in mind, this should work, and I tried to comment it to help you out, and kinda of follow the logic… esentially, you need an accum to keep track of the state of the lift. I didn’t try this out (this is all off the top of my head)… but you get the idea :slight_smile:

Also, I appreciate the effort you took into making this post :slight_smile: If this doesn’t work, I’ll try it myself.


(sock) #3

There is several problems with your entity set. You are missing a “func_invisible_user” brush. This is the interface between the user/player and the entity “target_script_trigger”. Plus you will need a button at the bottom of the lift, otherwise you will never be able to call the lift down.

Have a look at this diagram:

(Replace “levers” with “buttons” and “doors” with “lift”)

The “func_invisible_user” entity is the starting point in the chain where the user gets the hand icon to user the botton/lever. Then the “target_script_trigger” starts the script routine which is the name used in the “scriptname” key. The function is stored in the “target” field. In your example you are calling the routine: “move_lift” and function: “move_to_basement”. Your script does not have this combination that is why it does not work.

Have a look at this tutorial I did for RTCW. (It will work for ET as well, just maybe have some missing textures.)

http://www.planetquake.com/simland/pages/wolftut/tut01_door1.htm

I also have some more advanced lift combinations on the site which will allow you to control the flow of the lift while standing on it as well.

Sock
:moo:


(joop sloop) #4

the link in sock’s post isn’t working anymore try this one if you need the tutorial:
http://www.planetquake.com/simland/pages/articles/rtcw_doors.htm