Question about riddle/item triggering

Status
Not open for further replies.
Level 3
Joined
Sep 7, 2009
Messages
22
Alright, so I'm making a riddle that includes 7 potions. If you drink a certain one, you will be teleported to a region. If you drink any of the other six, it kills you.
My question is, how do I trigger it so that once you drink a potion, it is removed from your inventory and replaced in it's original position (all potions), and if you drink the one potion that teleports you to the region, how do I get it to teleport, remove from inventory, and then go back to original position for next player? :eekani:

Thanks!!

By the way... this is somewhat off topic, but how can you change the amount of damage a hero does?
 
Level 6
Joined
Aug 22, 2008
Messages
123
Main Question
The following codes are free hand made and meant to be an example to explain how you can make this work.

Use for the killing items one item type, for the porting one another, but both types should appear as the same.
On start, you should store the 7 items in an array and use a parallel point array that contains their specified position.
An example:
Code:
Place    Itemarray    Pointarray
1        Item 1       Pos of item 1
2        Item 2       Pos of item 2
3        Item 3       Pos of item 3
.
.
.

Next, you will need a trigger whose event uses "Unit acquires an item". Use an if-then-else in the actions. Like this:

Code:
for each Integer A from 1 to 7 do:
       If Itemarray[Integer A]==manipulated item then
       Drop manipulated item from triggering unit
       Move manipulated item to Pointarray[Integer A]
(endloop)

If Item type of (manipulated item) == Killing item type then
      Kill Triggering Unit
else
      Move Triggering unit to <targetpoint of that teleportation>
(endif)

Off-topic question:
You can adjust the damage a hero deals using his primary attribute and the basic attack properties that can be found in the Object Editor (basic attack damage, damager per dice, number of dices).:wink:
 
Level 3
Joined
Sep 7, 2009
Messages
22
Err... I'm pretty noob with the editor. Could you explain that a bit more noob friendly? Like in step by step? :p

Thanks for the reply :)
 
Level 6
Joined
Mar 20, 2008
Messages
208
Alright, so I'm making a riddle that includes 7 potions. If you drink a certain one, you will be teleported to a region. If you drink any of the other six, it kills you.
My question is, how do I trigger it so that once you drink a potion, it is removed from your inventory and replaced in it's original position (all potions), and if you drink the one potion that teleports you to the region, how do I get it to teleport, remove from inventory, and then go back to original position for next player? :eekani:

Thanks!!

By the way... this is somewhat off topic, but how can you change the amount of damage a hero does?

Something like this?
correctpotion is a custom variable of type Item.

Pop in the regions you want the hero to move to and the items to respawn at. (You'll have to place these too)

Throw in the other potion types as the if-then checks

  • Events
    • Unit - A unit Uses an item
  • Conditions
  • Actions
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • (Item-type of (Item being manipulated)) Equal to (Item-type of correctpotion)
      • Then - Actions
        • Unit - Move (Triggering unit) instantly to (Center of (Playable map area))
        • Item - Create (Item-type of correctpotion) at (Center of B1 <gen>)
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • ((Triggering unit) has an item of type Potion of Greater Healing) Equal to True
          • Then - Actions
            • Item - Create Potion of Greater Healing at (Center of B2 <gen>)
          • Else - Actions
      • Else - Actions
        • Unit - Kill (Triggering unit)
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • ((Triggering unit) has an item of type Potion of Greater Healing) Equal to True
          • Then - Actions
            • Item - Create Potion of Greater Healing at (Center of B2 <gen>)
          • Else - Actions
 
Level 6
Joined
May 13, 2009
Messages
260
Err... I'm pretty noob with the editor. Could you explain that a bit more noob friendly? Like in step by step? :p

Thanks for the reply :)

First you press the [F6] button on your keyboard or press the helmet next to the sound thingy. After that you the units tab and search for the hero/unit you want to change. The damage of a unit is in Combat - Attack 1 - Damage Base, Combat - Attack 1 - Damage Number of Dice and Combat - Combat Attack 1 - Damage Sides per Die. Hope it makes things clearer :)
 
Level 3
Joined
Sep 7, 2009
Messages
22
Something like this?
correctpotion is a custom variable of type Item.

Pop in the regions you want the hero to move to and the items to respawn at. (You'll have to place these too)

Throw in the other potion types as the if-then checks

  • Events
    • Unit - A unit Uses an item
  • Conditions
  • Actions
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • (Item-type of (Item being manipulated)) Equal to (Item-type of correctpotion)
      • Then - Actions
        • Unit - Move (Triggering unit) instantly to (Center of (Playable map area))
        • Item - Create (Item-type of correctpotion) at (Center of B1 <gen>)
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • ((Triggering unit) has an item of type Potion of Greater Healing) Equal to True
          • Then - Actions
            • Item - Create Potion of Greater Healing at (Center of B2 <gen>)
          • Else - Actions
      • Else - Actions
        • Unit - Kill (Triggering unit)
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • ((Triggering unit) has an item of type Potion of Greater Healing) Equal to True
          • Then - Actions
            • Item - Create Potion of Greater Healing at (Center of B2 <gen>)
          • Else - Actions

You're close, but I don't want the person to have to use the potion. I want them to pick it up and then the effect will happen instantly, without the player doing anything. How would I do that? and how would I create the variable?

+rep to whoever can answer!! :)
 
Level 6
Joined
May 13, 2009
Messages
260
The unit acquires an item is used when the player picks it up :) This trigger is leak free to i think :D
  • Leak free
    • Events
      • Unit - A unit Acquires an item
    • Conditions
    • Actions
      • Set aleak_loc1 = (Center of (Playable map area))
      • Set aleak_loc2 = (Center of B1 <gen>)
      • Set aleak_loc3 = (Center of B2 <gen>)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Item-type of (Item being manipulated)) Equal to (Item-type of correctpotion)
        • Then - Actions
          • Unit - Move (Triggering unit) instantly to aleak_loc1
          • Item - Create (Item-type of correctpotion) at (Center of (Playable map area))
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Triggering unit) has an item of type Potion of Greater Healing) Equal to True
            • Then - Actions
              • Item - Create Potion of Greater Healing at aleak_loc3
            • Else - Actions
        • Else - Actions
          • Unit - Kill (Triggering unit)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Triggering unit) has an item of type Potion of Greater Healing) Equal to True
            • Then - Actions
              • Item - Create Potion of Greater Healing at aleak_loc3
            • Else - Actions
      • Custom script: call RemoveLocation ( udg_aleak_loc1 )
      • Custom script: call RemoveLocation ( udg_aleak_loc2 )
      • Custom script: call RemoveLocation ( udg_aleak_loc3 )
 
Level 6
Joined
Mar 20, 2008
Messages
208
You're close, but I don't want the person to have to use the potion. I want them to pick it up and then the effect will happen instantly, without the player doing anything. How would I do that? and how would I create the variable?

+rep to whoever can answer!! :)

You just set the event to unit acquires an item.....
I highly suggest you peruse the list of events and actions.
 
Status
Not open for further replies.
Top