• 🏆 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!

Converting integer to value

Status
Not open for further replies.
Level 19
Joined
Aug 8, 2007
Messages
2,765
Hey i am making a quest and heres where im stuck at.

I have when u turn in one item of a quest it increases the value of the integer by 1 and when the integer reaches 3 you will receive quest rewards.

I have all of that except, I cant find the condition thats like

  • Integer - Value of (QuestRabbitHinds) Equal to 3
Can anyone help?
 
Level 35
Joined
Oct 9, 2006
Messages
6,392
Well while not being 100% sure I know what you want, I can answer you overall question as yes there is such a function.

You can find it when you make a variable (the variable stores a value), but you can easily change it to be an integer it saves it as...

Try to look around in that area (its in the string + string part). I wish I had time to write the complete trigger for you, but I need sleep.

Anyway if you still can't find it, I'll do my best to get it shown tomorrow. Good luck




Btw: Post 2555 :grin:
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
I guess he wants a quest where you need to collect something and once you have 3 of them, the quest is done?

Well, you already said you increased an integer by 1 every time you deliver a quest item to the quest giver.
I don't really get the problem then :/
  • Actions
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • QuestRabbitHinds Equal to 3
      • Then - Actions
        • //Actions
      • Else - Actions
        • //Actions
(Condition can be found in Condition -> Integer comparison).
 
Level 19
Joined
Aug 8, 2007
Messages
2,765
the problem is i need a GUI condition that checks if the value of this variable(QuestRabbitHinds) is 3
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
the problem is i need a GUI condition that checks if the value of this variable(QuestRabbitHinds) is 3
I guess he wants a quest where you need to collect something and once you have 3 of them, the quest is done?

Well, you already said you increased an integer by 1 every time you deliver a quest item to the quest giver.
I don't really get the problem then :/
  • Actions
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • QuestRabbitHinds Equal to 3
      • Then - Actions
        • //Actions
      • Else - Actions
        • //Actions
(Condition can be found in Condition -> Integer comparison).

Yes...
I think that the condition "QuestRabbitHinds Equal to 3" is exactly what you are looking for.
 
Level 19
Joined
Aug 8, 2007
Messages
2,765
its there. just keep looking.

Your not helping.

And fail. i forgot that theres a Value section of a triggering thing right under options -.-

Now i got a new problem tho. I need to give the reward to every hero that helped -.-
 
Level 35
Joined
Oct 9, 2006
Messages
6,392
Now I got a new problem though. I need to give the reward to every hero that helped :bored:


You could save every unit that damages the unit (for a time period to ensure that someone that hit it long ago also receives a reward) or you can pick every unit in an area around the killed unit and give the reward to all picked units.

Or you can make them add themselves to a party group before questing (if what your doing allows for that). Then it would just be a matter of adding reward to all members of the group.
 
Level 19
Joined
Aug 8, 2007
Messages
2,765
Not what im looking for.

Lets say im using a unit array for a quest. Each unit that gives a rabbit limb is added to the array. Once there is 3, it gives the quest reward to every unit in the array.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,202
Oh thats easy, you use a separate variable to count the total number of units in the array (also doubling as providing the next index to insert a unit into and the end point to stop looping when looping through the array.

You run your conditional check every time you add a unit to the array.

For example.
n is the counter
u is the unit array.

When adding a unit to the array.
u[n] = unit to add
n=n+1

the value of n will be 0 when no units are in the array, 1 when 1 unit is, 2 when 2 units are, etc.

You then check if n == 3 and if so you run your questi completion code.
Its that simple.
 
Status
Not open for further replies.
Top