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
 
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 :)
 
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...)
 
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?
 
> 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.
 
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
 
Use Triggering unit instead of Hero manipulating item, I think thats a bit faster.
 
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 The Helper:
    News portal has been retired. Main page of site goes to Headline News forum now
  • The Helper The Helper:
    I am working on getting access to the old news portal under a different URL for those that would rather use that for news before we get a different news view.
  • Ghan Ghan:
    Easily done
    +1
  • The Helper The Helper:
    https://www.thehelper.net/pages/news/ is a link to the old news portal - i will integrate it into the interface somewhere when i figure it out
  • Ghan Ghan:
    Need to try something
  • Ghan Ghan:
    Hopefully this won't cause problems.
  • Ghan Ghan:
    Hmm
  • Ghan Ghan:
    I have converted the Headline News forum to an Article type forum. It will now show the top 20 threads with more detail of each thread.
  • Ghan Ghan:
    See how we like that.
  • The Helper The Helper:
    I do not see a way to go past the 1st page of posts on the forum though
  • The Helper The Helper:
    It is OK though for the main page to open up on the forum in the view it was before. As long as the portal has its own URL so it can be viewed that way I do want to try it as a regular forum view for a while
  • Ghan Ghan:
    Yeah I'm not sure what the deal is with the pagination.
  • Ghan Ghan:
    It SHOULD be there so I think it might just be an artifact of having an older style.
  • Ghan Ghan:
    I switched it to a "Standard" article forum. This will show the thread list like normal, but the threads themselves will have the first post set up above the rest of the "comments"
  • The Helper The Helper:
    I don't really get that article forum but I think it is because I have never really seen it used on a multi post thread
  • Ghan Ghan:
    RpNation makes more use of it right now as an example: https://www.rpnation.com/news/
  • The Helper The Helper:
  • The Helper The Helper:
    What do you think Tom?
  • tom_mai78101 tom_mai78101:
    I will have to get used to this.
  • tom_mai78101 tom_mai78101:
    The latest news feed looks good
  • The Helper The Helper:
    I would like to see it again like Ghan had it the first time with pagination though - without the pagination that view will not work but with pagination it just might...
  • The Helper The Helper:
    This drink recipe I have had more than a few times back in the day! Mind Eraser https://www.thehelper.net/threads/cocktail-mind-eraser.194720/

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top