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

[Solved] Simple Question and trigger why it doesn t worok

Status
Not open for further replies.
Level 6
Joined
Aug 10, 2010
Messages
77
Code:
Crystal1
    Události
        Jednotka - A unit owned by Hráč 1 (ÄŤervenĂ˝) ZaÄŤĂná pouĹľĂvat schopnost
    PodmĂnky
        (Unit-type of (Casting unit)) Rovná se |cFFBF0000Crystal|r cave
        (Ability being cast) Rovná se Buy 1 Crystal
        (Hráč 1 (červený) Stav dřeva) Většà nebo rovno 30
    ÄŚinnosti
        Hráč - Add -30 to Hráč 1 (červený) Stav dřeva
        Set Crystals = (Crystals + 1)
        Ăškol - Display to (All players) the Tip message: You have received 1...

This code works for ability 1.
next 3. are almost the same and only conditions are changed :)
My question would be if the triggers are wrong or abilities in Object manager
Lets imagine i have created Shop for crystals, Crystals is Variable

I made 4 abilities with Copy paste
1. Buy 1 Crystal for 30 Gems
2. Buy 10 Crystal for 300 Gems
3. Buy 100 Crystal for 3000 Gems
4. Buy 1000 Crystal for 30 000 Gems

When I click on random ability they are clicked all 4 why? I think it is by abilities because they are almost similar, also there has to be a solution.
 

Attachments

  • T4.PNG
    T4.PNG
    12 KB · Views: 40
  • T3.PNG
    T3.PNG
    12.1 KB · Views: 35
  • T2.PNG
    T2.PNG
    11.9 KB · Views: 38
  • T1.PNG
    T1.PNG
    11.8 KB · Views: 37
Last edited:
Level 20
Joined
Feb 23, 2014
Messages
1,264
Uhm, mate - I think it would help if you translated the code to English. More people would be able to understand what is going on and thus it'd be easier to help you.

EDIT:

I think I have found the issue and I have a possible solution - though it might not be the best one, it should work.

Did you just "copy" the first ability you created? If so, try making the same 2nd, 3rd, etc. abilities off of some other base abilities.

The reason is that the game treats copies of the same abilities as the same thing, i.e. if you press a button for "Buy 1 ability", it will trigger all 4 of them anyway. I haven't found other solution to this problem than just to use different GUI abilities as base.
 
Last edited:
Level 25
Joined
Sep 26, 2009
Messages
2,378
@slovak27 - when you are posting GUI triggers (that's what you posted just now), use the [TRIGGER][/TRIGGER] tags.
When you are using jass, use the [code=jass][/code] tags.

I translated it
  • Crystal1
    • Events
      • Unit - A unit owned by Player 1 (Red) begins casting an ability //not sure if it is "... begins..." or "starts the effect..."
    • Conditions
      • (Unit-type of (Casting unit)) Equal to |cFFBF0000Crystal|r cave
      • (Ability being cast) Equal to Buy 1 Crystal
      • (Player 1 (Red) current Lumber) Greater than or Equal to 30
    • Actions
      • Player - Add -30 to Player 1 (Red) Current Lumber
      • Set Crystals = (Crystals + 1)
      • Game - Display to (All players) the Tip message: You have received 1...
 
Level 20
Joined
Feb 23, 2014
Messages
1,264
Well, based on that trigger - nothing should be wrong here.
I think the issue is, as was already said, with the abilities being built on the same base order ID.
 
Level 6
Joined
Aug 10, 2010
Messages
77
Thank you guys, Yep you are right with the solution. I found the solution too, but it makes limitation for creation of my world. I would like to have shop with another variable for example: Essence.It means another 4 abilites. :) Also you said the ID is problem but ID can t be rewritten, am I right? Also thank you guys for help and your time.

Yep I have forgot with [TRIGGER TRIGGER] tags. thanks.
 
Last edited:
Status
Not open for further replies.
Top