• 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.

[Trigger] with command - adding attributes

Status
Not open for further replies.
Level 4
Joined
Aug 8, 2008
Messages
64
hey,

maybe you know it too - korean rpg's
most you gain , str as example, when you type -str 1
when i tried it - i failed.....
so maybe can post it?
  • StatsUp Strength
    • Ereignisse
      • Spieler - Spieler 1 (Rot) types a chat message containing -str 1 as Exakte Übereinstimmung
      • Spieler - Spieler 2 (Blau) types a chat message containing -str 1 as Exakte Übereinstimmung
      • Spieler - Spieler 3 (Blaugrau) types a chat message containing -str 1 as Exakte Übereinstimmung
      • Spieler - Spieler 4 (Lila) types a chat message containing -str 1 as Exakte Übereinstimmung
      • Spieler - Spieler 5 (Gelb) types a chat message containing -str 1 as Exakte Übereinstimmung
      • Spieler - Spieler 6 (Orange) types a chat message containing -str 1 as Exakte Übereinstimmung
      • Spieler - Spieler 7 (Grün) types a chat message containing -str 1 as Exakte Übereinstimmung
      • Spieler - Spieler 8 (Rosa) types a chat message containing -str 1 as Exakte Übereinstimmung
      • Spieler - Spieler 9 (Grau) types a chat message containing -str 1 as Exakte Übereinstimmung
    • Bedingungen
    • Aktionen
      • Spieler - Add -1 to (Triggering player) Aktuelles Holz
      • Held - Modify Kraft of (Picked unit): Hinzufügen 1
sorry its german...
Spieler = Player
Kraft = Strength
Held = Hero
Hinzufügen = add/ adding
Aktuelles Holz = You wood what you have at the moment
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
Your problem is this (I think):
  • Actions
    • Held - Modify Kraft of (Picked unit): Hinzufügen 1
You say "Picked Unit", while no unit is picked in the event (only players are)
Use a variable or something to define the heroes

Also, this might be usefull:

  • Events
    • Player - Player 1 (Red) types a chat message containing -str as A substring
    • Player - Player 2 (Blue) types a chat message containing -str as A substring
    • Player - Player 3 (Teal) types a chat message containing -str as A substring
    • Player - Player 4 (Purple) types a chat message containing -str as A substring
    • Player - Player 5 (Yellow) types a chat message containing -str as A substring
    • Player - Player 6 (Orange) types a chat message containing -str as A substring
    • Player - Player 7 (Green) types a chat message containing -str as A substring
    • Player - Player 8 (Pink) types a chat message containing -str as A substring
    • Player - Player 9 (Gray) types a chat message containing -str as A substring
  • Conditions
    • ((Triggering player) Current lumber) Greater than or equal to (Integer((Substring((Entered chat string), 5, 7))))
  • Actions
    • Hero - Modify Strength of Player_Hero[(Player number of (Triggering player))]: Add (Integer((Substring((Entered chat string), 5, 7))))
    • Player - Add (-1 x (Integer((Substring((Entered chat string), 5, 7))))) to (Triggering player) Current lumber
Variable Needed:
"Player_Hero"
Type: Unit
Array: 9 (number of players)

It gives +XX str to the player's hero, but only if the player's lumber is greater than or equal to XX

e.g.:
-str 05 gives +5 str
-str 5 gives +5 str
-str 90 gives +90 str

I hope this helped, good luck with your project

Edit:
I'm sorry if you don't understand the english triggers, I can't translate them correctly, because I haven't got the german World Editor.
If you really don't know something, maybe I can give you a translation, or you could search it in a dictionary.
 
Level 9
Joined
Aug 21, 2008
Messages
533
@the post before me: you can use both i think

I made up one just try it. Note that you have to copy the event for evry player i didnt had the time:grin:

  • Untitled Trigger 001
    • Events
      • Player - Player 1 (Red) types a chat message containing - as A substring
    • Conditions
      • ((Triggering player) Current lumber) Greater than or equal to (Integer((Substring((Entered chat string), 5, 8))))
    • Actions
      • Set integer = (Integer((Substring((Entered chat string), 5, 8))))
      • Player - Add (-1 x integer) to (Triggering player) Current lumber
      • -------- The Unit group finds all heros by a player- if it is an rpg this should be only 1 --------
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in (Units in (Playable map area)(((Owner of (Matching unit)) Equal to (Triggering player)) and (((Matching unit) is A Hero) Equal to True))) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Substring((Entered chat string), 1, 4)) Equal to -int
            • Then - Actions
              • Hero - Modify Intelligence of (Picked unit): Add integer
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Substring((Entered chat string), 1, 4)) Equal to -agi
                • Then - Actions
                  • Hero - Modify Agility of (Picked unit): Add integer
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Substring((Entered chat string), 1, 4)) Equal to -str
                    • Then - Actions
                      • Hero - Modify Strength of (Picked unit): Add integer
                    • Else - Actions
                      • Player - Add integer to (Triggering player) Current lumber
The last else will make the lumber back if the player wasnt able to write -int or it was another chatmessege:thumbs_up:

How to get the jewels/crystals?
 
Level 8
Joined
Mar 12, 2008
Messages
437
The "crystals" are called reputation is given to you by other users when you have helped them.

By the way, Mr Slayer, that's a nice system, and I don't find any errors (don't listen to me though :p).



An alternative is to store the Heroes into variables with arrays instead of unit groups.
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
it didnt worked >.< im just losing wood and max attribute is -str 10 /agi&int
It worked perfectly for me when I tested this trigger :s
I can give you some screenshots if you like, maybe you copied the trigger wrong?

You've got 2 integers which the trigger will read, so the max should be 99
You can also use
  • (Integer((Substring((Entered chat string), 5, (Length of (Entered chat string))))))
That's indeed a better option, but the result should be the same.
 
Status
Not open for further replies.
Top