random death messages/random spawn

mastah_

New Member
Reaction score
5
hey i was wondering what the best way to make random spawn points (unit revives anywhere on map except in stupid places where he can get stuck) and also the best way to make a random death message so when a unit kills another unit it has a chance to say something like
"Killer just owned deadguy" or "deadguy had no chance against killer"
with more than one choice (a dozen or around there...)

so really lookin for the easiest and cleanest lookin way of doing this thxs
 

troyboy

New Member
Reaction score
5
Here is how to spawn at random place in PLAYABLE map area.

Code:
Melee Initialization
    Events
        Unit - A unit Dies
    Conditions
    Actions
        Hero - Instantly revive (Triggering unit) at (Random point in (Playable map area)), Show revival graphics
 

mastah_

New Member
Reaction score
5
Here is how to spawn at random place in PLAYABLE map area.

Code:
Melee Initialization
    Events
        Unit - A unit Dies
    Conditions
    Actions
        Hero - Instantly revive (Triggering unit) at (Random point in (Playable map area)), Show revival graphics


this dosn't work because there's cliffs on the map and around the edge and the hero can spawn on them and well get stuck...
 

Darthfett

Aerospace/Cybersecurity Software Engineer
Reaction score
615
I believe there is an "Is Location Pathable" type function under boolean comparisons.

However, it would be insanely complicated (without having to create rects covering these areas) to make a trigger that checks if the location actually leads out into the open areas of your map, and is not hidden in some trapped spot in the trees or mountains.
 

mastah_

New Member
Reaction score
5
I believe there is an "Is Location Pathable" type function under boolean comparisons.

However, it would be insanely complicated (without having to create rects covering these areas) to make a trigger that checks if the location actually leads out into the open areas of your map, and is not hidden in some trapped spot in the trees or mountains.

is there anyway to randomly select a players spawn location then? (as in red spawns at blues and blue spawns at yellow different everytime tho)


so no way to make random messages for death?
 

Chris B

New Member
Reaction score
7
Here's what darth was kinda saying. As for this, loop it until the path IS walkable, this is just a very rough sample. As for random message, give me a sec and I'll post up. If you want them to spawn at random regions that are preset, I can do that easily.

Trigger:
  • Actions
    • Set death_param = (Random point in (Playable map area))
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • (Terrain pathing at death_param of type Walkability is off) Equal to False
      • Then - Actions
        • Hero - Instantly revive (Triggering unit) at (Random point in (Playable map area)), Show revival graphics
      • Else - Actions


-Chris
 

mastah_

New Member
Reaction score
5
Here's what darth was kinda saying. As for this, loop it until the path IS walkable, this is just a very rough sample. As for random message, give me a sec and I'll post up. If you want them to spawn at random regions that are preset, I can do that easily.

Trigger:
  • Actions
    • Set death_param = (Random point in (Playable map area))
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • (Terrain pathing at death_param of type Walkability is off) Equal to False
      • Then - Actions
        • Hero - Instantly revive (Triggering unit) at (Random point in (Playable map area)), Show revival graphics
      • Else - Actions


-Chris

thxs but that might be like wat darth said about the hero reviving in a place thats walkable but like... stuck behind a tree or something... so a random regions that are preset would be great thxs
 

Chris B

New Member
Reaction score
7
K, Here's the random message. Note that the triggering unit is the unit dying lol, these are just the actions too :p

Trigger:
  • Actions
    • Set rand = (Random integer number between 1 and 5)
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • rand Equal to 1
      • Then - Actions
        • Game - Display to (All players) the text: ((Name of (Triggering player)) + ( Got Slaughtered By + (Name of (Owner of (Killing unit)))))
      • Else - Actions
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • rand Equal to 2
          • Then - Actions
            • Game - Display to (All players) the text: ((Name of (Triggering player)) + ( got owned by + (Name of (Owner of (Killing unit)))))
          • Else - Actions
            • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • rand Equal to 3
              • Then - Actions
                • Game - Display to (All players) the text: ((Name of (Owner of (Killing unit))) + ( Crushed In + ((Name of (Triggering player)) + 's Skull)))
              • Else - Actions

.....and so on (not that the random number only goes to 5. If it's 5, you MUST have 5 random messages, so in this Ex, you'd need 2 more or you'd get no message about 40% of deaths).

I'll go get the respawn done and post those up for you

-Chris
 

Chris B

New Member
Reaction score
7
K, here's the random respawn. The only difference is, you would want to change No Region to your preset regions. Same thing in this case, atm it has rand 1-5, change 5 to how many respawns you have, and make sure you have exactly that many respawns in the trigger.

Trigger:
  • Actions
    • Set rand = (Random integer number between 1 and 5)
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • rand Equal to 1
      • Then - Actions
        • Hero - Instantly revive (Triggering unit) at (Center of No region), Show revival graphics
      • Else - Actions
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • rand Equal to 2
          • Then - Actions
            • Hero - Instantly revive (Triggering unit) at (Center of No region), Show revival graphics
          • Else - Actions
            • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • rand Equal to 3
              • Then - Actions
                • Hero - Instantly revive (Triggering unit) at (Center of No region), Show revival graphics
              • Else - Actions


BTW, it's the same concept, and you could put the two so that random respawn and messages are together (like, if rand = 1, then respawn here and say XXX), but doing so would reveal the respawn location of the hero lol.

-Chris
 

Dinowc

don't expect anything, prepare for everything
Reaction score
223
there are color codes for each color
you put the color codes in an array string variable
and you can use them like this:

set (something where you put texts, like multiboard) to text: (color_string[player number of (some player, example player 2)] + (some text) + |r

so the text will be displayed in blue

I think I explained nothing but feel free to ask and I will post the whole trigger for this
 

mastah_

New Member
Reaction score
5
thxs for help both of u...dinowc thats what i started to do thxs :)
btw is there a link u can give me of just the player colors (1-12) thxs
+rep
 

Dinowc

don't expect anything, prepare for everything
Reaction score
223
playercolors.jpg


these are NOT whole codes, at each end of a code you must put |r, but this is how you must put them in a string array
so for example |c00ff0000Mary|r
this will be displayed as Mary

there is a tool that can generate color codes for every possible color, try looking here: http://www.hiveworkshop.com/forums/tools.php under "Text Markup / Colors"
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top