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

Interger

Status
Not open for further replies.
Level 14
Joined
Aug 30, 2004
Messages
909
I'm not entirely sure what you mean, but I'll see what I can do.

You could make a boolean variable called "HasItem" and an item variable: BankItem In the trigger do this:

set HasItem=false
set BankItem = no item
For every Integer A from 1 to 6 do:
- if (item being manipulated) = Item[A] then set HasItem=true
- if (item being manipulated) = Item[A] then set BankItem=Item[A]
//end of For loop
if HasItem = true, then move BankItem to Bank

or something...
 
Level 8
Joined
Jun 26, 2010
Messages
530
[TRIGGER="Freehanded"]Events
Unit - unit obtains an item
Conditions
Multiple Conditions Or - ANY conditions are true
Unit have item - axe
Unit have item - hammer
Unit have item - condoms
Actions
Order (unit manipulating item) to drop (item being manipulated)
Game - display to ((owner of(triggering unit)) the text: you can only have on item of level 3 at a time[/TRIGGER]
 
Level 14
Joined
Aug 30, 2004
Messages
909
[TRIGGER="Freehanded"]Events
Unit - unit obtains an item
Conditions
Multiple Conditions Or - ANY conditions are true
Unit have item - axe
Unit have item - hammer
Unit have item - condoms
Actions
Order (unit manipulating item) to drop (item being manipulated)
Game - display to ((owner of(triggering unit)) the text: you can only have on item of level 3 at a time[/TRIGGER]

Soulburn's is better than mine; I say use his.
 
Level 6
Joined
May 8, 2010
Messages
150
Soulburn's is better than mine; I say use his.

Yeh i knew how to do that already, just wondering if there was a way to do a range of numbers in an action.
+ I got the actions and all sorted, its just i want a condition that covers all the type of items..
and all the types of items will be put in a variable.. for exampleeee ItemCape..
and in the condition i want it to check if the hero has ItemCape[every number possible] so i dont have to edit this trigger everytime a cape gets added into the map, if you understand me a bit more clearer?

+ Alien, i think i know what you mean.. il get back to you if i get it sorted, if not il ask for help.. again ^.^

EDIT, Alien can you write show me what you mean..
 
Level 8
Joined
Jun 26, 2010
Messages
530
Try that.

[TRIGGER="Freehanded"]Events
Unit - unit obtains an item
Conditions
Actions
Foor Each Integer A from 1 to 5 - do multiple actions
loop - actions
If - Then - Else - Multiple Conditions
If - Conditions
Unit have item - ItemVariableblablabla [integer A]
Then - Actions
Order (unit manipulating item) to drop (item being manipulated)
Game - display to ((owner of(triggering unit)) the text: you can only have on item of that type at a time
Else - Actions[/TRIGGER]
 
Level 13
Joined
Mar 4, 2009
Messages
1,156
Try that.

this will check if any of Boolean[from 1 to 5] are true
[TRIGGER="Freehanded"]Events
Unit - unit obtains an item
Conditions
Actions
Foor Each Integer A from 1 to 5 - do multiple actions
loop - actions
If - Then - Else - Multiple Conditions
If - Conditions
Multiple Conditions Or - ANY conditions are true
Unit have item - ItemVariableblablabla [integer A]
Order (unit manipulating item) to drop (item being manipulated)
Game - display to ((owner of(triggering unit)) the text: you can only have on item of that type at a time[/TRIGGER]
you dont need "Multiple Conditions Or - ANY conditions are true"

1th way
  • Actions
    • For each (Integer A) from 1 to 10, do (Actions)
      • Loop - Actions
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • Boolean[(Integer A)] Equal to True
          • Then - Actions
            • Your Actions...
          • Else - Actions
            • Your Actions...
2th way would be to use Or - Any Conditions are true and place Boolean variables from 1 to 10 in the loop of it,1th way is much shorter in this case

so it would look lke this

  • Conditions
    • Or - Any (Conditions) are true
      • Conditions
        • Boolean[1] Equal to True
        • Boolean[2] Equal to True
        • Boolean[3] Equal to True
        • ...
 
Level 6
Joined
May 8, 2010
Messages
150
[trigger=Trigger]
CastBeginsDaggers
Events
Unit - A unit Begins casting an ability
Conditions
(Ability being cast) Equal to CHANNEL
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Or - Any (Conditions) are true
Conditions
((Triggering unit) has an item of type Daggers[1]) Equal to True
((Triggering unit) has an item of type Daggers[2]) Equal to True
((Triggering unit) has an item of type Daggers[3]) Equal to True
((Triggering unit) has an item of type Daggers[4]) Equal to True
Then - Actions
Item - Move (Target item of ability being cast) to (Center of Banks[(Player number of (Owner of (Triggering unit)))])
Floating Text - Create floating text that reads Moved To Bank above (Triggering unit) with Z offset 0.00, using font size 8.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
Floating Text - Set the velocity of (Last created floating text) to 64.00 towards 90.00 degrees
Floating Text - Change (Last created floating text): Disable permanence
Floating Text - Change the lifespan of (Last created floating text) to 2.50 seconds
Floating Text - Change the fading age of (Last created floating text) to 1.50 seconds
Else - Actions
Hero - Give (Target item of ability being cast) to (Triggering unit)
Unit - Order (Triggering unit) to move (Target item of ability being cast) to inventory slot 1
Unit - Order (Triggering unit) to Stop
[/trigger]

That is what ive got, and it doesnt work.. when it picks up another item of the same type it doesnt do anything -_-
 
Level 8
Joined
Jun 26, 2010
Messages
530
you dont need "Multiple Conditions Or - ANY conditions are true"

I know, i began typing something than jsut remembered something better. You posted almost after i posted, u probably don't noticed i edited it haha :p

Well, i would give this thread solved for now.
 
Status
Not open for further replies.
Top