• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!

Text Over Unit Help

Status
Not open for further replies.
Level 3
Joined
Jun 18, 2008
Messages
30
Allright guys, Im still working on Gates of the Brave ORPG and I would like to implement this sytem into it. Ive seen this in an rpg before... Im pretty sure it was Crusade.
I want player chat text over unit. Heres the thing I cant figure out:


  • Talk
    • Events
      • Player - Player 1 (Red) types a chat message containing <Empty String> as A substring
      • Player - Player 2 (Blue) types a chat message containing <Empty String> as A substring
      • Player - Player 3 (Teal) types a chat message containing <Empty String> as A substring
      • Player - Player 4 (Purple) types a chat message containing <Empty String> as A substring
      • Player - Player 5 (Yellow) types a chat message containing <Empty String> as A substring
      • Player - Player 6 (Orange) types a chat message containing <Empty String> as A substring
      • Player - Player 7 (Green) types a chat message containing <Empty String> as A substring
      • Player - Player 8 (Pink) types a chat message containing <Empty String> as A substring
    • Conditions
    • Actions
      • Floating Text - Create floating text that reads (((Name of (Triggering player)) + says: ) + (Entered chat string)) above (Last created unit) with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
      • Floating Text - Set the velocity of (Last created floating text) to 64.00 towards 90.00 degrees
      • Floating Text - Change (Last created floating text): Disable permanence
      • Floating Text - Change the fading age of (Last created floating text) to 2.00 seconds
      • Floating Text - Change the lifespan of (Last created floating text) to 4.00 seconds
Ok, that seems right to me, but there is one thing that isnt.
My ORPG does not use taverns for selection of Heroes. It used the LOAP type unit selection. So After a unit enters the region to get his hero, the action "last created unit" is used. Then, once another player gets his hero, it switches that text over to that hero, and since there are 8 players, each of them need to be able to talk over there selected hero.
Ughh qite mindboggling. :[
 
Level 3
Joined
Mar 12, 2007
Messages
62
You could assign each hero a variable and use that to see which hero is which, but i think theres several more simple solutions
 
Level 11
Joined
Dec 8, 2006
Messages
334
Just create variable named Hero, type of this variable will be Unit and array will be 12.
Now, when player choose hero through your "LOAP type unit selection system", just set variable Hero[player number of (playerThatChoosesHero)] to Last Created Unit

Simple
Now the action in your trigger will be like
Floating Text - Create floating text that reads (((Name of (Triggering player)) + says: ) + (Entered chat string)) above (Hero[Player number of(triggering player)]) with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency

Is my post readable by the way?
 
Level 3
Joined
Jun 18, 2008
Messages
30
This is a bit hard to understand.
Do you mean create a variable named selected hero, array 1-12
then on each of my hero selection triggers,
now could you explain how I would set each variable to each hero?
Please and thanks :D

EDIT: Will give rep for answer
 
Level 7
Joined
Jul 20, 2008
Messages
377
My, my. It's been a while since I last posted here.

This is a bit hard to understand.
Do you mean create a variable named selected hero, array 1-12
then on each of my hero selection triggers,
now could you explain how I would set each variable to each hero?
Please and thanks :D

EDIT: Will give rep for answer

How much about variables do you know?
 
Level 3
Joined
Sep 13, 2008
Messages
63
  • Untitled Trigger 002
    • Events
    • Conditions
    • Actions
      • Set Heroes[(Player number of (Triggering player))] = (Last created unit)
  • Untitled Trigger 001
    • Events
      • Player - Player 1 (Red) types a chat message containing <Empty String> as A substring
    • Conditions
    • Actions
      • -------- Heroes is a unit variable with a array of 12 --------
      • Floating Text - Create floating text that reads (Entered chat string) above Heroes[(Player number of (Triggering player))] with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
      • -------- You know the rest... --------
 
Status
Not open for further replies.
Top