• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!
  • ✅ The POLL for Hive's Texturing Contest #34 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!
  • ✅ The POLL for Hive's Techtree Contest #20 is OPEN! Vote for the TOP 3 FACTIONS! 🔗Click here to cast your vote!

HUD, 3rd person camera and keyboard movement

Status
Not open for further replies.
Level 8
Joined
Nov 20, 2008
Messages
445
Posting an example here how to create custom UI on screen(HUD) and an example of how you can code a movement system using keyboard keys(Along with TPC).

EDIT: Updated the map with better HUD(Target frame is in now). Smoother movement system(Along with mouse control). And added a basic way to create a custom attack system(Tho thats just experimenting).

To use:
Left Click - Just rotates the camera around the hero without him following its angle.
Right Click - Rotates the camera around the hero forcing him to always run in its angle.

Selecting a Unit - Shows it in the Target Frame(Still no proper portrait just a placeholder) and if its an enemy it will start the attack. To attack it you just need to be withing given range(in this case 1.5).

Due to locking the camera to prevent moving it out of focus for the hero you can use the mouse scroll to zoom only when you are holding one of the mouse buttons.
 

Attachments

Last edited:
Thanks. I had some problem with the camera jumping instantly 180 degrees to the left sometimes, but I think I see why now. Anyways, the key press/release thing could be done like this:

Have one array
Code:
bool[256] keyState
that has default values to FALSE.
Then the On Key Pressed and On Key Released triggers go like this:

  • onKeyUp
    • Events
      • UI - Player Any Player presses None key Up with shift Allow, control Allow, alt Allow
    • Local Variables
    • Conditions
    • Actions
      • Variable - Set keyState[EventKeyPressed()] = false
  • onKeyDown
    • Events
      • UI - Player Any Player presses None key Down with shift Allow, control Allow, alt Allow
    • Local Variables
    • Conditions
    • Actions
      • Variable - Set keyState[EventKeyPressed()] = true
Then you can track every damn key with just those two triggers, no need for mass variable and mass events for each key.
 
Yeah you're right. But just as I said this is an example of whats possible. Not really aiming to make it work good(Wont bother untill we properly get Galaxy Scripting). Just testing the possibilities of the editor ^^
 
Thanks. I had some problem with the camera jumping instantly 180 degrees to the left sometimes, but I think I see why now. Anyways, the key press/release thing could be done like this:

Have one array
Code:
bool[256] keyState
that has default values to FALSE.
Then the On Key Pressed and On Key Released triggers go like this:

  • onKeyUp
    • Events
      • UI - Player Any Player presses None key Up with shift Allow, control Allow, alt Allow
    • Local Variables
    • Conditions
    • Actions
      • Variable - Set keyState[EventKeyPressed()] = false
  • onKeyDown
    • Events
      • UI - Player Any Player presses None key Down with shift Allow, control Allow, alt Allow
    • Local Variables
    • Conditions
    • Actions
      • Variable - Set keyState[EventKeyPressed()] = true
Then you can track every damn key with just those two triggers, no need for mass variable and mass events for each key.

Awesome! Thanks!
 
So you could look up the terrain and see that it was the same, but couldn't just check the fucking triggers and see that they are not his but decided to just annoy me ehh ?

And for the suckiness i think i already mentioned that those are just examples of what can be done. I didnt even consider making this good and multi player instancable.
 
You took the map from sc2napster and just removed some things.
That is what is looks like. The terrain is identical.

About annoying you:
I am so sorry that I annoy you for stealing other peoples work.

Someone needs a girlfriend:con:
 
How it comes that terrain and such things are identical as well?
By the way, the scripts suck, they are not even MPI.

They weren't supposed to be MPI, as RaiN said it was just an example so people can build their own systems... But here is the MPI version of mine:

Variable:
Code:
keyState[256][16]

  • onKeyDown
    • Events
      • UI - Player Any Player presses None key Down with shift Allow, control Allow, alt Allow
    • Local Variables
    • Conditions
    • Actions
      • Variable - Set keyState[EventKeyPressed()][(Triggering player)] = true
  • onKeyDown
    • Events
      • UI - Player Any Player presses None key Up with shift Allow, control Allow, alt Allow
    • Local Variables
    • Conditions
    • Actions
      • Variable - Set keyState[EventKeyPressed()][(Triggering player)] = false
Happy now?
 
How do you attack with this system?

Also, found a glitch.

Move forward than hold down the backward button than release forward. You will move without playing the animation.
 
Yeah, there are still some buggs and I'm gonna post a new map later today with way more functionality like mouse control, the target frame(and unit targeting ofc) and some basic attacking method(tho it currently looks ugly) and ofcourse this system MPI as I see people really whine for stuff like that...
 
Lol take ur time. i know most of us want this for 3PS-MMO's and both of those cant be done without heroes, and most of us dont wanna do the triggers for heroes.
 
Updated the map(You can find it at first post). Removed everything that wasnt done by me(hope people stop whining). Even changed the terrain...
 
Status
Not open for further replies.
Back
Top