Cleanup is going to take awhile, so the site is back up but editing has been disabled.

User-Controlled items

From HalfLife 2 Knowledge Base

Jump to: navigation, search

What is game_ui good for ?

Its a very nifty entity that lets you take the player input, say WASD and attack buttons plus more, and convert them into stuff happening ingame.

Like Press forward and a thruster activates, back and it deactivates.

How to create vehicles and other user operated objects

Its simple to use:

Step 1: Create a func_Button

Step 2: Set the flags

  • Don't move
  • Toggle
  • Use Activates

Step 3: Set "Delay before reset" in the properties to 0

delay0hs.gif


Step 4: Create two env_sprites, to indicate if the game_ui is active or not

  • Use these two sprites:
    • materials/Sprites/greenglow1.vmt
    • materials/Sprites/redglow1.vmt
  • The sprite with the redglow should have the flag "Start on" checked
  • Name both sprites "sprite"

sprite.JPG


Ok, here comes the glory of it all:

Step 5: Make a game_ui entity and name it game_ui

Step 6: Goto the output tab and make these outputs:

output.JPG

This will toggle the two sprites whenever you enter or exit the game_ui, Enter = Red off, Green on. vice versa

Step 7: Go back to the Buttons output tab and make these two outputs:

output2.JPG

That means when you press the button activate the game_ui, and when you press it again deactivate game_ui

Which will then turn on/off the sprites...

Its now ready for your input...

Step 8: In the Game_ui output tab you have these options (and some more not discussed in this tutorial as of yet)

  • PlayerOn: Triggers when the player enters the game_ui
  • PlayerOff: opposite of PlayerOn
  • PressedAttack: Primary Attack
  • PressedAttack2: Secondary Attack
  • PressedBack: Equals S if u have defualt settings
  • PressedForward: Equals W if u have defualt settings
  • PressedMoveLeft: Equals A if u have defualt settings
  • PressedMoveRight: Equals D if u have defualt settings


NEED A SYSOP WHO KNOWS HOW TO FINISH THIS TUTORIAL TO FINISH I AM BUSY PORTING OVER MORE TUTORIALS

Personal tools