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

A bit of trouble with a quest.

Status
Not open for further replies.
Level 6
Joined
Dec 9, 2014
Messages
176
So I have this quest where you gather wool from sheep, after you have 5 tufts of wool you turn it in, simple enough, right? Well, I'd rather the player not be able to gather the wool from the same sheep twice, at least not for a while anyway. I've been screwing with the triggers in hopes of figuring out how to make it so that once you've gathered wool from one sheep you can gather from a different one, but not the same one. Here's the triggers I have so far, any help is much appreciated and I'm not stingy about reputation lol!

Not Initially On:
  • Bandages Start
    • Events
      • Player - Player 1 (Red) Selects a unit
    • Conditions
      • (Triggering unit) Equal to Brom |cffffcc002|r 0006 <gen>
      • ((Sorceress is in (Units in (Region centered at (Position of Brom |cffffcc002|r 0006 <gen>) with size (350.00, 350.00)))) Equal to True) or ((Wizard is in (Units in (Region centered at (Position of Brom |cffffcc002|r 0006 <gen>) with size (350.00, 350.00)))) Equal to True)
    • Actions
      • Trigger - Turn on Bandages Count <gen>
      • Trigger - Turn on Bandages Count 2 <gen>
      • Wait 0.30 seconds
      • Special Effect - Destroy QuestAvailable[2]
      • Quest - Create a Optional quest titled Bandaids, Quick! with the description |cff33CC33Brom:|r "..., using icon path ReplaceableTextures\CommandButtons\BTNScroll.blp
      • Quest - Display to Player Group - Player 1 (Red) the Quest Update message: Bring 5 Tufts of Wo...
      • Set BandageQuest = (Last created quest)
      • Trigger - Turn off (This trigger)
Not Initially On:
  • Bandages Count
    • Events
      • Player - Player 1 (Red) Selects a unit
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Sheep |cffffcc001|r
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • NoSheepWool Equal to (Unit-type of (Triggering unit))
        • Then - Actions
          • Game - Display to Player Group - Player 1 (Red) the text: You just gathered f...
        • Else - Actions
          • Set TuftsOfWool = (TuftsOfWool + 1)
          • Game - Display to Player Group - Player 1 (Red) for 3.00 seconds the text: ((String(TuftsOfWool)) + /5 Tufts of Wool Collected)
          • Set NoSheepWool = (Unit-type of (Triggering unit))
      • Wait 30.00 seconds
      • Set NoSheepWool = SheepWool
Not Initially On:
  • Bandages Count 2
    • Events
      • Player - Player 1 (Red) Selects a unit
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Sheep |cffffcc001|r
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • TuftsOfWool Equal to 5
        • Then - Actions
          • Special Effect - Create a special effect attached to the overhead of Brom |cffffcc002|r 0006 <gen> using Objects\RandomObject\RandomObject.mdl
          • Set QuestComplete[2] = (Last created special effect)
          • Sound - Play PeasantBuildingComplete1 <gen>
          • Game - Display to Player Group - Player 1 (Red) for 6.00 seconds the text: Now return that woo...
          • Trigger - Turn off Bandages Count <gen>
          • Trigger - Turn off (This trigger)
        • Else - Actions
          • Do nothing
Initially On:
  • Bandages Complete
    • Events
      • Player - Player 1 (Red) Selects a unit
    • Conditions
      • TuftsOfWool Equal to 5
      • (Triggering unit) Equal to Brom |cffffcc002|r 0006 <gen>
      • ((Sorceress is in (Units in (Region centered at (Position of Brom |cffffcc002|r 0006 <gen>) with size (350.00, 350.00)))) Equal to True) or ((Wizard is in (Units in (Region centered at (Position of Brom |cffffcc002|r 0006 <gen>) with size (350.00, 350.00)))) Equal to True)
    • Actions
      • Special Effect - Destroy QuestComplete[2]
      • Quest - Mark BandageQuest as Completed
      • Quest - Display to Player Group - Player 1 (Red) the Quest Update message: Bandaids, Quick! |c...
      • Game - Display to Player Group - Player 1 (Red) the text: |cffCC00CCEXP: +250...
      • Hero - Add 250 experience to Sorceress, Show level-up graphics
      • Hero - Add 250 experience to Wizard, Show level-up graphics
      • Wait 4.00 seconds
      • Game - Display to Player Group - Player 1 (Red) the text: |cff33CC33Brom:|r "...
      • Unit - Add Roasted Pork Rejuv HP and MP to Brom |cffffcc002|r 0006 <gen>
      • Item - Create Payment for Tufts of Wool at (Position of Brom |cffffcc002|r 0006 <gen>)
      • Trigger - Turn off (This trigger)
Any help is much appreciated and if anything needs more explaination, please let me know.
 
Level 25
Joined
May 11, 2007
Messages
4,651
So to "wool" a sheep you select it?

Just do:

Events: Player Dz selects a unit
Conditions:
Unit-Type of unit == Sheep
boolean(unit is in WooledSheep) == false
Actions:
Hero - Create item wool for heroDz
unitgroup add selected unit to WooledSheep
 
Level 6
Joined
Dec 9, 2014
Messages
176
So to "wool" a sheep you select it?

Just do:

Events: Player Dz selects a unit
Conditions:
Unit-Type of unit == Sheep
boolean(unit is in WooledSheep) == false
Actions:
Hero - Create item wool for heroDz
unitgroup add selected unit to WooledSheep

Ahh, Boolean check. Gotcha, I'll try that and see if that works. Thanks!
 
Level 21
Joined
Aug 13, 2011
Messages
739
You could just set sheep mana to 1 and its mana regeneration to 0.03. Check if the sheep has 1 mana. If it does, deduct that mana and it'll restore in 33 seconds with no extra variables like in this example map.
 

Attachments

  • Wool.w3x
    10 KB · Views: 48
Level 6
Joined
Dec 9, 2014
Messages
176
You could just set sheep mana to 1 and its mana regeneration to 0.03. Check if the sheep has 1 mana. If it does, deduct that mana and it'll restore in 33 seconds with no extra variables like in this example map.

Nice! That's awesome. I'm gonna go with that. Crap, now I gotta go through and delete the variables I don't need lol

Edit: So I'd like to change the sheep in some small way to indicate that it has been gathered from. I've been running through the effects and a couple of them look like they would make good indicators, but I'm wondering if you guys have any suggestions on what to use? I could just put a special effect above their heads or maybe change the unit altogether into a sheep with different tint colors. What do you guys think?
 
Last edited:
Level 25
Joined
May 11, 2007
Messages
4,651
Do my thing cuz I'm awesome. Herp derp.

Then when a sheep is selected add a custom devation aura (targets set to self) with a custom buff named "Wooled" to the unit, set the buff model to whatever ye want.
 
Level 6
Joined
Dec 9, 2014
Messages
176
Do my thing cuz I'm awesome. Herp derp.

Then when a sheep is selected add a custom devation aura (targets set to self) with a custom buff named "Wooled" to the unit, set the buff model to whatever ye want.

So I did just that, because that's an awesome idea, thank you! But, I ran into a problem. I can't seem to figure out how to make the buff from the Devotion Aura actually work. I'll post the triggers as well as screens of the ability and buff, hopefully you can tell me what I did wrong.


  • Bandages Count
    • Events
      • Player - Player 1 (Red) Selects a unit
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Sheep |cffffcc001|r
      • ((Sorceress is in (Units in (Region centered at (Position of (Triggering unit)) with size (350.00, 350.00)))) Equal to True) or ((Wizard is in (Units in (Region centered at (Position of (Triggering unit)) with size (350.00, 350.00)))) Equal to True)
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Triggering unit) is in SheeredSheep) Equal to True
        • Then - Actions
          • Game - Display to Player Group - Player 1 (Red) the text: You've already shea...
        • Else - Actions
          • Set TuftsOfWool = (TuftsOfWool + 1)
          • Game - Display to Player Group - Player 1 (Red) for 3.00 seconds the text: ((String(TuftsOfWool)) + /5 Tufts of Wool Collected)
          • Unit Group - Add (Triggering unit) to SheeredSheep
          • Unit - Add Sheared to (Triggering unit)
          • Wait 60.00 seconds
          • Unit Group - Remove (Triggering unit) from SheeredSheep
          • Unit - Remove Sheared from (Triggering unit)
Ability:
Sheared_Ability_Data.jpg


Buff:
Sheared_Buff_Data.jpg
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,223
Wouldn't the "Self" target be sufficient?
If some other test is not causing it to fail. Targets Allowed is notorious for never doing what you hope it would. Before even using your custom buff simply use the default devotion aura one and work with that until you get it only one the owner sheep. This will rule out anything wrong with your buff (which you can then add back after it is working).
 
Level 6
Joined
Dec 9, 2014
Messages
176
So after a whole lot of hair pulling trial and error, I found that the ability works perfectly if I put it on anything other than that sheep! So this tells me the problem is in something like "Targeted as". I change that to the exact same as any other unit that the ability is working on and it still wont work! Is there something fundamentally wrong with the sheep unit? Is it a badly coded unit or something?
 
Level 6
Joined
Dec 9, 2014
Messages
176
So I figured out that "Self" only works if the unit's "Targeted As" is "Ground"... That's so weird. Anyhow, this would be fine if it weren't for the face that I don't want the sheep getting killed, that's the whole reason I gave the sheep no "Targeted as" setting in the first place. For now, I have the sheep with an invulnerable ability. Later, I might add another computer controller labeled as "Neutral Wildlife", set it as neutral and add sheep to it. But I don't know if that will help or not. For now, I like the way it's working. :ogre_haosis: As soon as I have the first recipe for my First Aid Profession working I'll upload the next alpha version in the Map Development thread. Thanks for all the help!
 
Status
Not open for further replies.
Top