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

[Trigger] Items with more abilities

Status
Not open for further replies.
Level 8
Joined
Nov 9, 2008
Messages
502
Hi.
I have put an item stacking system in my map and have given an item the abilities 'potion of clarity' and a modified 'scroll of speed'. The aim is to create a potion that restores mana with a reduction of speed but when I use the potion in tests 2 are consumed in a single click.

Is there something I'm missing in the object editor to prevent this?

Also, I'm very curious why the abilities used for items have levels. Is there a way to manipulate this and add levels to an ability when an item is used successively without triggering it?
For example, given the 'potion of clarity' effect gives mana over time, adding a level would increase the duration and amount of mana gained effectively stacking the potion's effect. So consuming 10 pots in quick succession would produce a much faster rate of mana gain.

EDIT:
I made a trigger to simulate the same effects while adding leveling but the auras keep disappearing and reappearing !!

  • weedbonus
    • Events
      • Unit - A unit Uses an item
    • Conditions
      • (Item-type of (Item being manipulated)) Equal to Weed (nr)
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Brilliance Aura for (Triggering unit)) Equal to 0
        • Then - Actions
          • Unit - Add Brilliance Aura to (Triggering unit)
          • Unit - Add Dopey to (Triggering unit)
          • Wait 20.00 seconds
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Level of Brilliance Aura for (Triggering unit)) Equal to 1
            • Then - Actions
              • Unit - Remove Brilliance Aura from (Triggering unit)
              • Unit - Remove Dopey from (Triggering unit)
            • Else - Actions
              • Wait until ((Level of Brilliance Aura for (Triggering unit)) Equal to 1), checking every 1.00 seconds
              • Unit - Remove Brilliance Aura from (Triggering unit)
              • Unit - Remove Dopey from (Triggering unit)
        • Else - Actions
          • Unit - Increase level of Brilliance Aura for (Triggering unit)
          • Unit - Increase level of Dopey for (Triggering unit)
          • Wait 20.00 seconds
          • Unit - Decrease level of Brilliance Aura for (Triggering unit)
          • Unit - Decrease level of Dopey for (Triggering unit)


I attached the map if you can't see the problem from the trigger, I sure can't. Why are the buffs disappearing ????
 

Attachments

  • dealer.w3x
    87.8 KB · Views: 49
Last edited:
Level 8
Joined
Nov 9, 2008
Messages
502
I think you are right about item abilities but you are missing the point about my trigger.

The trigger works fine in that it levels the abilities if at least one pot has been consumed and checking if hero's ability = 0 is the same as checking if hero has a buff at all.

I don't think you have tested it as you don't seem to know what I'm explaining. I think the problem lies somewhere in the waits because occasionally the buffs from the given abilities will disappear while the abilities are still shown to be active in the hero's skills window.

I would really appreciate it if someone could have a look or possible explain an alternative.
Thank you.
 
Level 9
Joined
Apr 3, 2008
Messages
700
Conditions like this
(Level of Brilliance Aura for (Triggering unit)) Equal to 0
AND
(Level of Brilliance Aura for (Triggering unit)) Equal to 1
will never allow a trigger to run.

Try to make
if ability level = 0 then
<...>
else
<...>
 
Level 8
Joined
Oct 28, 2007
Messages
435
Give your item an modified ability of Spellbook and change the abilities inside the spellbook to the abilities you want your item to do. This will allow your item to have up to 11 activated abilities. Last time I checked it also works correctly with charges....

So you can have a Universal Potion (stupid example) that can restore mana, life or a bit of life and mana.

Youl have to copy the Spellbook and Change its added abilities to the abilities of a life, mana and a restoration potion.

I did this in my map chaos... the item .... Baccob's Spellbook allows you to cast: Frost Armor, Edited version of the dragon hawk's net, an edited version of storm bolt and the ability to reset the cooldown of all abilities.

For your item ability levels you will need to use a dummy ability:

Give your item an edited ability from the ability Channel
Create a trigger that cause whenever you use the item the charges should increase by 1. This would disable the fact that charges get reduced when you use the item. This item should also create a dummy unit (invis with locust) to cast the items actual ability. You then set the level the ability it should cast to the amount of charges of the item.
Create your own trigger of how to improve the charges of the item and in effect improve the level of the spell.
 
Level 8
Joined
Nov 9, 2008
Messages
502
Thank you KYTON you have given me a few ideas but this is still not solved. I do intend to use a spellbook to hide the abilities the item gives but giving the item the spellbook doesn't produce the right effect I'm after. Also, I'm not familiar with Channel, you meant to use this as a dud spell to trigger the dummy?

Anyway,
let me reiterate the aim of this item's use.

- A charged item that when used it will give mana regen at the price of movement speed.
- When used more than once the effects stack (positive and negative) and duration is increased
- Must have a duration
- 1 click use (no targets, only self)
- Perishable, charges are spent per use

The fairly simple trigger I used works fine as far as giving the abilities/leveling them goes (thank you very much Day-Elven :slp:). The only thing wrong is the weird buggy thing where the buffs disappear for a second every so often. Seriously, just test it on my map and see for yourself. I can't explain it.

EDIT: I need to base a lot of items from a system like this so it's important this works right.
 
Last edited:
Level 13
Joined
May 11, 2008
Messages
1,198
oh it's a clarity potion instead of mana potion...i see...hmm...now to load the map and test in game...

edit: tested it...ok i'm not really an expert on triggers but i can recommend that you lower the number on the unit minimum movement speed in gameplay constants.
also i'm not sure that you are using an effective system for mana regeneration...you might try augmenting that.
other than that i'm not sure what you want the spell to do with the stacking...but my guess is that the duration isn't lasting long enough.

edit2: well if you are having your paladin mana regen 0 just for testing purposes then that makes sense. yeah i haven't done something like this before so i'm not much help. all i can say it keep messing around with the triggers or the object data and see what changes what if you don't like something. trial and error.


ah nevermind...i don't understand your item stack system lol
i might as well leave this text but i think it's just nonsense, if so, disregard:

edit3: ok after taking a second look around i think i caught something you may have missed that might somehow be messing around with your trigger. you have bundle of lumber ability having brilliance aura, and it goes up to level 5....i'm not sure how significant that is but it's worthy of note because when using the item the auras go up to level 10 so it appears that perhaps you used to have the bundle of lumber have that ability/buff and you moved it to another item and now you forgot it's still on there.

i'm referring to the ability. i was looking at your item stack system because it was intriguing and i noticed that the bundle of lumber was used for the item stack system. and when i went to the ability to confirm that it gives 0 lumber i noticed that brilliance aura is in there and that bundle of lumber has 5 levels.

edit: ok i finally understand you did automatically use when acquired and no ability. and item already perishable...oh how funny it doesn't need to be perishable i made the claws of attack disappear when made it automatic use when acquired. but you can't pick it up unless it has no ability...unless you give it an ability like bundle of lumber
 
Last edited:
Level 8
Joined
Oct 28, 2007
Messages
435
Sorry, didn't get your request but do now.

I couldn't find any problems with the ability, but I think you should rather do the following:

Create a trigger when the unit use your potion
The let the trigger create 2 dummy units and let one of them cast a edited version of slow at the level of the users buff +1 and the other one cast an edited version of regeneration which only regains mana also at 1 level highter than the buff, so you will do something like this (sorry I don't know the gui anymore so it might wrong)

  • Event
  • Unit - Uses an item
  • Condition
  • Item - Item type of Manipulated item equal to YourItem
  • Actions
  • Set - TempPoint to Get Unit Location (Hero Manipulating Item)
  • Unit - Create DummyUnit at TemPoint facing 0
  • Unit - Add Slow to last Created Unit
  • CustomScript - set udg_TempInteger=GetUnitAbilityLevel(GetManipulatingHero(),'Bslo')+1
  • Unit - Set last Create Unit's level of Slow to TempInteger
  • Unit - Issue last Created unit to Human - Sorceress Slow Hero Manipulating Item
Just do that then also for your replenish mana ability.
Replace the 'Bslo' with the rawcode of your buff.

What I do with the custom script is I get the level of the heroes buff and add 1
 
Level 8
Joined
Nov 9, 2008
Messages
502
@SanKakU - I don't know what you're trying to say. To understand the item stacking visit the tutorial I used:
RDZ's Incredible Item Stacking System of Doom

@KYTON - I tried you suggestion but the map wouldn't load = there is something wrong. Just to find the problem I removed the custom script from the trigger and it loaded fine so there must be an error with the custom script. Are you sure you can get the level of a buff active on a unit? Doesn't that function work rather by finding the level of an ability the unit already has? Remember, the unit using the potion wont have the ability slow.
Here is the trigger I used from your suggestion, a little edited:

  • Untitled Trigger 002 Copy
    • Events
      • Unit - A unit Uses an item
    • Conditions
      • (Item-type of (Item being manipulated)) Equal to Weed (nr)
    • Actions
      • Unit - Create 1 dummy for Neutral Hostile at (Position of (Hero manipulating item)) facing 0.00 degrees
      • Unit - Add Slow to (Last created unit)
      • Custom script: set udg_TempInteger=GetUnitAbilityLevel(GetManipulatingHero(),'Bslo')+1
      • Unit - Set level of Slow for (Last created unit) to TempInteger
      • Unit - Order (Last created unit) to Human Sorceress - Slow (Hero manipulating item)
      • Unit - Kill (Last created unit)
      • Unit - Remove (Last created unit) from the game
P.S. I heard that when removing units from the game it's safer to kill them first...
 
Level 7
Joined
Jul 20, 2008
Messages
377
No such thing. You don't have to kill an unit before removing it. You're probably thinking of timers.

But first of all, check your dummy unit's mana. Second, check the Slow spell's mana cost and order string.
 
Level 8
Joined
Nov 9, 2008
Messages
502
Dummy is fine, no mana cost for Slow and I left the order string default. I don't know how order strings work.

I'm using the jassnewgen editor which stops the map from loading when there's a faulty trigger so I don't think it's to do with the object values. I'm suspicious of the custom script. Are you sure you can grab the level of an active buff?

EDIT: I'm pretty sure it's not possible to grab the level of a buff soooo.... I found a way around to do the same thing.

TempInteger = 1

  • Untitled Trigger 002
    • Events
      • Unit - A unit Uses an item
    • Conditions
      • (Item-type of (Item being manipulated)) Equal to Weed (nr)
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Hero manipulating item) has buff Slow) Equal to False
        • Then - Actions
          • Unit - Create 1 dummy for (Owner of (Hero manipulating item)) at (Position of (Hero manipulating item)) facing 0.00 degrees
          • Unit - Add Slow to (Last created unit)
          • Unit - Order (Last created unit) to Human Sorceress - Slow (Hero manipulating item)
          • Unit - Remove (Last created unit) from the game
          • Wait until (((Hero manipulating item) has buff Slow) Equal to False), checking every 1.00 seconds
          • Set TempInteger = 1
        • Else - Actions
          • Set TempInteger = (TempInteger + 1)
          • Unit - Create 1 dummy for (Owner of (Hero manipulating item)) at (Position of (Hero manipulating item)) facing 0.00 degrees
          • Unit - Add Slow to (Last created unit)
          • Unit - Set level of Slow for (Last created unit) to TempInteger
          • Unit - Order (Last created unit) to Human Sorceress - Slow (Hero manipulating item)
          • Unit - Remove (Last created unit) from the game
I had a feeling I would have to resort to global variables. Anyway, I think this is as good as it will get. Only problem is say buff reaches level 10 and just before effect is lost he consumes another potion granting him the effects for the duration of the level 10 ability (duration of lvl 10 is significantly greater than lvl 1).This is a big exploit. There is a system of 'overdose' which I've been thinking of which will limit the amount of items one can consume at once I guess I will have to include limiting this exploit in that system.

It's not preferencial; I would like it if the buff degraded over time so unit would have to consume more to sustain it BUT it will have to do.

Thanks all and +rep of course for those who contributed.

EDIT: Awesome, I can use a dynamic wait function to do the degradation. Wait 10 x (10/TempInteger) then recast slow.
 
Last edited:
Level 8
Joined
Oct 28, 2007
Messages
435
Hey thanks for the rep... I'm rather sure that you can get the level of a buff... In GUI when you check if a unit has a buff, the actual Code behind the GUI checks if the level of the buff for the unit is greater than 0... altough your right, you can't check the level of the buff without custom script.

The fact that it gives a syntax error means I must have made a typo....
Hey.... OOps.... You should make it:
Custom Script set TempInteger=GetUnitAbilityLevel(GetManipulatingUnit(),'BUFF ID')

not GetManipulatingHero() sorry... I got confused with all the gui...

I'm pretty sure this should work...or it should atleast compile...


Oh...and the id should aways be between '
 
Status
Not open for further replies.
Top