• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

A riddle with consequences.

Status
Not open for further replies.
Level 2
Joined
Jul 9, 2008
Messages
25
In part of my map I am presenting the player with a simple riddle: they are asked a question, and are given the choice to answer it or walk away. They answer the riddle by typing the answer as a message. If it is the correct answer they are rewarded. I know how to do that part.

What is giving me trouble is making it so that the player suffers consequences for answering incorrectly. I want this consequence to happen if the player types anything other than the defined answer. Is it possible to do this? Doing it within the GUI would be preferred.
 
Level 13
Joined
Mar 24, 2010
Messages
950
Yes its possible, i need more info though. What do you want to happen to the unit? you want it to happen to 1 unit? is that unit a hero? will there only be 1 hero owned by the player making the guess to the answer etc..
 
Level 2
Joined
Jul 9, 2008
Messages
25
http://img12.imageshack.us/f/riddle.png/

When a hero owned by the player enters the region in the circle marked A, the player is asked the question. If they answer correctly, an item is created in circle A. If the player says anything other than the desired answer while one of their heroes is in the circle, units hostile to the player will be created at a region marked at B.
 
Level 13
Joined
Mar 24, 2010
Messages
950
I dont know if you have your heros assigned to a unit var but you should. It would be the easiest way, i gave you 2 options to choose from.

The 2nd is alot better and easier.

  • Trig A
    • Events
      • Player - Player 1 (Red) types a chat message containing <Empty String> as A substring
    • Conditions
    • Actions
      • Set Temp_UnitGroup = (Units owned by (Triggering player) matching (((Matching unit) is A Hero) Equal to True))
      • Unit Group - Pick every unit in Temp_UnitGroup and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Entered chat string) Equal to correct answer
              • (Region A <gen> contains (Picked unit)) Equal to True
            • Then - Actions
              • Item - Create Crown of Kings +5 at (Center of Region A <gen>)
            • Else - Actions
              • Unit - Create 3 Knight for Neutral Hostile at (Center of Region B <gen>) facing Default building facing degrees
      • Custom script: call DestroyGroup (udg_Temp_UnitGroup)
I would do this one
  • Trig
    • Events
      • Player - Player 1 (Red) types a chat message containing <Empty String> as A substring
    • Conditions
      • (Region A <gen> contains Player_Hero[(Player number of (Triggering player))]) Equal to True
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Entered chat string) Equal to correct answer
        • Then - Actions
          • Item - Create Crown of Kings +5 at (Center of Region A <gen>)
        • Else - Actions
          • Unit - Create 3 Knight for Neutral Hostile at (Center of Region B <gen>) facing Default building facing degrees
let me know if this isnt what you wanted.
 
Status
Not open for further replies.
Top