constructable with func_door_rotating


(GRouZER) #1

What changes do i have to make in my script file to have a working rotating door (func_door_rotating) in the constructable?

script so far:


game_manager
    {
   spawn 
    {
    }
       }


construction_script 
{ 
   spawn 
   { 
      wait 200 
      constructible_class 2 
      trigger self startup 
   } 

   buildstart final 
   { 
   } 

   built final 
   { 
      setstate construction_target  default 
      setstate const_tower        invisible 

      // Some kind of UI pop-up to alert players 
      wm_announce   "Allied team has built a watchtower!" 
   } 

   decayed final 
   { 
      trigger self startup 
   } 

   death 
   { 
      trigger self startup 
      // Some kind of UI pop-up to alert players 
      wm_announce   "Axis team has destroyed the watchtower!" 
   } 

   trigger startup 
   { 
      setstate construction_target  invisible 
      setstate const_tower        default 
   } 
} 



(G0-Gerbil) #2

off the top of my head, not much?
setstate-ing the func_rotating should work fine
I don’t know whether it’d be usable during construction phase though - if it is and you don’t want it to be, use a dummy script_mover in the closed position, and setstate THAT construction, and when finally built, setstate it invisible, and setstate the door default.

What currently happens?


(GRouZER) #3

but when i set the doors to func_door_rotating and select the constructable incl the doors and make that a func_constructable the func_door_rotating changes into func_constructable.


(G0-Gerbil) #4

No no, don’t make the door part of the func_constructible.
I think I see where you are going now.

What I’d probably do first is simply leave the door as a seperate entity and check it can be hidden / shown using setstate.

If it can, then onwards to:

  • Make the constructible stuff, with a dummy door (IE not a func_door_rotation, just a brush that mimics it’s closed position.
  • Make all that into a func_constructible
  • Copy this, and in the copy delete the dummy door. Turn this copy into a script_mover
  • Create your func_door
  • Now set up your map as you would normally for a constructible, but make sure it all references the constructible stuff (the one with the dummy door). Ignore / hide (or even move for now just to check) the script_mover and func_door.

Now, you’ll need to follow this logic:

At map start, hide all the entities using setstate invisible.
Make your script for the construction as normal, EXCEPT:

in the built function, setstate invisible the func_constructible, and setstate default both the script_mover and func_door

That should do the trick, although you are probably about to tell me you want itt to be able to be blown up again as well :wink:


(GRouZER) #5

That should do the trick, although you are probably about to tell me you want itt to be able to be blown up again as well

uhm yes :), is it not possible if i follow these instructions?

Doesn’t the “setstate func_door_rotating invisible” affect all func_door_rotatings?


(G0-Gerbil) #6

That was my lazy way of typing out a setstate script - I can see I’ve caused a bit of confusion.
setstate works in the following way:

setstate <ENTITY_TARGETNAME> <STATE>

where:

<ENTITY_TARGETNAME> is the targetname of your entity :wink: As far as I’m aware it’ll work on pretty much any in-game entity.
<STATE> is either default, invisible, or constructing

so if you give your func_door a key of targetname with a value of wibble, and want to hide it, you’d do:

setstate wibble invisible

HTH