Item Recipe (JASS help)

kallieblakie

New Member
Reaction score
5
I have a simple item system which follows:
Code:
Medallion of Courage
    Events
        Unit - A unit Acquires an item
    Conditions
        And - All (Conditions) are true
            Conditions
                ((Hero manipulating item) has an item of type Gauntlets of Ogre Strength) Equal to True
                ((Hero manipulating item) has an item of type Slippers of Agility) Equal to True
                ((Hero manipulating item) has an item of type Mantle of Intelligence) Equal to True
    Actions
        Item - Remove (Item carried by (Hero manipulating item) of type Gauntlets of Ogre Strength)
        Item - Remove (Item carried by (Hero manipulating item) of type Slippers of Agility)
        Item - Remove (Item carried by (Hero manipulating item) of type Mantle of Intelligence)
        Hero - Create Medallion of Courage and give it to (Hero manipulating item)
        Special Effect - Create a special effect attached to the origin of (Hero manipulating item) using Abilities\Spells\Items\AIlm\AIlmTarget.mdl
        Special Effect - Destroy (Last created special effect)

This trigger works perfectly, except that I have about 40 other triggers like this one. So when a Hero buys and item, it lags for a short while, which I think is because of the triggers. Is there anyway to make it not lag with GUI, or a system in JASS that would make it not laggy at all? If there is, can someone post the trigger for me?

Thanks in advance
 

ManyTimes

I'm so lonesome I could cry...
Reaction score
293
You can add waits in 30 of them, so all 40 is spread out over 0.3 seconds or so. Make 10 of them without any waits, first 10 with 0.05 sec wait..etc...blablabla

Yes, which mean you have to use "if then else" and put the conditions inside the "if" and wait before the "if then else"...But, only 40 should not lag, I mean..hmm depends on computer maybe :)

ED! Lol, as ace said, do that also, and no, I didnt even see that you actually had "and"-function in the condition the first time :)
 

AceHart

Your Friendly Neighborhood Admin
Reaction score
1,495
A tiny improvement could come from removing the "And", and just put the conditions directly.
They are "and" by nature already.
(Eliminates some 100+ function calls...)
 

kallieblakie

New Member
Reaction score
5
Doesn't really remove the lag. Tried. Plus, by default, sometimes i get bugs like, having only 2 items and the recipe occurs. So i put a "and". Any Jass scripting that I can use? What bout the one dota uses?
 

AceHart

Your Friendly Neighborhood Admin
Reaction score
1,495
> Any Jass scripting that I can use?

That would (greatly) improve the condition handling by removing the "and"s that aren't helping anything anyway...


Well, take one of your triggers, use "Edit / Convert to custom script", and post it here.
With any luck, someone might reply with an improved version.
 

MoonSlinger

I Love using Cheap Tricks... only Results matters
Reaction score
74
Something you might try:

Instead of making a trigger for each and every item, you can try making one BIG trigger which sorts all of them:

E.g.
Code:
Combine
E: Unit - A unit Acquires an item
C:
A:
If / Then / Else
.. Conditions
.. .. <Your Conditions for first recipe>
.. Then
.. .. Item - Remove Item 
.. .. Special Effect - 
.. .. Skip Remaining Codes

If / Then / Else
.. Conditions
.. .. <Your Conditions for other recipe>
.. Then
.. .. Item - Remove Item 
.. .. Special Effect - 
.. .. Skip Remaining Codes

So instead of running 30 events concurrently, you run one with more lines of codes, That would remove the need for waits
 
M

Maelstrom_

Guest
Use Triggering unit instead of Hero manipulating item, I think thats a bit faster.
 

kallieblakie

New Member
Reaction score
5
won't it be the same? it has one function asking for the person. I wonder if anyone know how dota recipe works?
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top