• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

multiple questions..

Status
Not open for further replies.
Level 4
Joined
Mar 27, 2009
Messages
66
Only 2 questions remain, how would i go about making a "make" button...where if i press it, if the player has the required items in his inventory it makes the new item and removes the items used to make the new item.

{EDIT 1}
another question...how would i make it so when i press a ability...it will shoot an arrow but only if they have enough wood?
 
Last edited:
  • Angry
Reactions: Rui
Level 8
Joined
Aug 19, 2007
Messages
294
Do NOT double post...Read the RULES!.
If you have you forgot to say anything in your post, then use the "Edit" botten
Edit.jpg
 
Level 10
Joined
Jan 28, 2009
Messages
394
I dunno about your second question but the first 1 is very easy. This was a map i gave up on making but i kept it to show people how to do stuff. It has a fully functioning "crafting" system like the 1 you asked about.
Try it out and make a "camp fire".
 
Last edited:
Level 13
Joined
Sep 14, 2008
Messages
1,407
I am not sure but MAYBE this will solve your second problem:

Use a trigger:

Event: Unit starts casting ability
Condition: Ability being cast = YourArrow
Action:

If(OwnerOfTriggeringUnits(Wood) > YourValue)
Then: Nothing
Else:
Unit stop
DisplayTextTo(OwnerOfTriggeringUnit)(Not enough wood)


I am not completly sure that this will work... Just try it
 
Level 7
Joined
Feb 6, 2008
Messages
133
try this
  • Test 1
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to ABILITY
    • Actions
      • Unit - Pause (Casting unit)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Player X (COLOR) Current lumber) Equal to 999
        • Then - Actions
          • Player - Set Player X (COLOR) Current lumber to ((Player X (COLOR) Current lumber) - 999)
          • Unit - Unpause (Casting unit)
        • Else - Actions
          • Game - Display to (COLOR) the text: You do not have enough lumber to cast ABILITY.
          • Unit - Order (Casting unit) to Stop
          • Unit - Unpause (Casting unit)
try this
  • Test 2
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to ABILITY
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Player X (COLOR) Current lumber) Equal to 999
        • Then - Actions
          • Player - Set Player X (COLOR) Current lumber to ((Player X (COLOR) Current lumber) - 999)
        • Else - Actions
          • Game - Display to (COLOR) the text: You do not have enough lumber to cast ABILITY.
          • Unit - Order (Casting unit) to Stop
 
Level 11
Joined
May 31, 2008
Messages
698
Just a couple things to fix:
Change action to a unit starts the effect of an ability
Change the condition to lumber is greater than or equal to 999 (or whatever)
And dont pause it or order it to stop...
For casting the ability, what i wolud do is make either a triggered ability, or if its based off shockwave make a dummy ability and then make the actual ability (different base order ID) and then order the unit to cast the dummy ability if they have the lumber. The stop thing might work, but if you begin to cast and stop casting it will take away lumber even though you didnt finish casting the ability.
 
Level 4
Joined
Mar 27, 2009
Messages
66
awesome, thanks for everyone's help :)

i got another question now tho...how would i make a trigger that spawns A LOT of items just like everywhere.
 
Status
Not open for further replies.
Top