Item Compination Causes Lag

CrazyWolf

New Member
Reaction score
4
Hi everyone

I found somewhere this system for combining items.It works fine but whenever i pick up an item or create one for the first time i lag.Is there a problem with the trigger or i just have to make a unit pick up all the items on the beggining of the game?

Note that there are 45 same triggers as the one below and the reason i am asking if i should create a unit in the beggining and order him to pick them up is that there are about 90 items in my map and that could cause my problems(picking all of them at map initialization).

Code:
Agility Bracer re
    Events
        Unit - A unit Acquires an item
    Conditions
        (Item-type of (Item carried by (Triggering unit) of type Agility Bracer Recipe)) Equal to Agility Bracer Recipe
        (Item-type of (Item carried by (Triggering unit) of type Cardinal's Ring)) Equal to Cardinal's Ring
        (Item-type of (Item carried by (Triggering unit) of type Medallion Of Courage)) Equal to Medallion Of Courage
    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
            Then - Actions
                Set ItemCreatePos[1] = (Position of (Triggering unit))
                Item - Remove (Item carried by (Triggering unit) of type Agility Bracer Recipe)
                Item - Remove (Item carried by (Triggering unit) of type Cardinal's Ring)
                Item - Remove (Item carried by (Triggering unit) of type Medallion Of Courage)
                Item - Create Agility Bracer at ItemCreatePos[1]
                Hero - Give (Last created item) to (Triggering unit)
                Special Effect - Create a special effect at (Position of (Triggering unit)) using Abilities\Spells\Items\AIem\AIemTarget.mdl
                Special Effect - Destroy (Last created special effect)
                Custom script:   call RemoveLocation( udg_ItemCreatePos[1] )
            Else - Actions

Ty in advance.
 
It's enough that you simply preplace all possible combined items (for example Agility Bracer from the trigger above) on the map and then remove them all on Map Initialization.
Might take some time to do this since you have that many combinations though, but there isn't much of an easier way.
 
This is just a wild guess, but could it be because all 45 triggers share that same event? Because if you had a good number of triggers that have item overlapping war3 might be going through all those triggers at the same time checking for the exact right conditions and then running all the actions and then end up only doing the "then" actions for one trigger; and the "else" for the others.

This is the way I do my items if it isn't a location entry (which mine are).

Code:
Agility Bracers
[B]Events[/B] [INDENT]Unit - A unit acquires an item[/INDENT]
[B]Conditions[/B][INDENT]Item of type #1 carried [B]AND[/B] item type #2 [B]AND[/B] Item type #3 carried[/INDENT]
[B]Actions[/B][INDENT]Remove item #1
Remove item #2
Remove item #3
Create Item #4
Give item #4[/INDENT]

I got a little skimpy on the actions/conditions because you know what I mean.:)

Using what I posted, the game will only cycle through one trigger's actions. And I don't know why my code had all those extra lines in it.
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • 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 The Helper:
    Happy Thursday!
  • Ghan Ghan:
    I'm not so sure, there's still a lot of Thursday left for it to become unhappy.
    +3
  • The Helper The Helper:
    still a few hours
  • The Helper The Helper:
    Its Friday!!!!
    +1
  • Ghan Ghan:
    Thursday 7/10 would Thursday again
    +3

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top