MPI or not?

jnZ

I
Reaction score
64
Since i cant use JassNewGen anymore (those error messages while in test-mode were very useful to me) i dont know if this trigger is MPI or not, however it seems to work fine.

This is the trigger:
Code:
Bomb Explosion Player 1
    Events
        Unit - A unit Dies
    Conditions
        (Unit-type of (Triggering unit)) Equal to Bomb
    Actions
        Set BombExplosionPoint[1] = (Position of (Triggering unit))
        For each (Integer LoopBombExplosion[1]) from 1 to PowerupFire[1], do (Actions)
            Loop - Actions
                Set BombExplosionPoint[(LoopBombExplosion[1] + 1)] = (BombExplosionPoint[1] offset by ((128.00 x (Real(LoopBombExplosion[1]))), 0.00))
        For each (Integer LoopBombExplosion[1]) from 1 to PowerupFire[1], do (Actions)
            Loop - Actions
                Set BombExplosionPoint[(LoopBombExplosion[1] + 13)] = (BombExplosionPoint[1] offset by ((-128.00 x (Real(LoopBombExplosion[1]))), 0.00))
        For each (Integer LoopBombExplosion[1]) from 1 to PowerupFire[1], do (Actions)
            Loop - Actions
                Set BombExplosionPoint[(LoopBombExplosion[1] + 25)] = (BombExplosionPoint[1] offset by (0.00, (-128.00 x (Real(LoopBombExplosion[1])))))
        For each (Integer LoopBombExplosion[1]) from 1 to PowerupFire[1], do (Actions)
            Loop - Actions
                Set BombExplosionPoint[(LoopBombExplosion[1] + 37)] = (BombExplosionPoint[1] offset by (0.00, (128.00 x (Real(LoopBombExplosion[1])))))
        Special Effect - Create a special effect at BombExplosionPoint[1] using Objects\Spawnmodels\Human\HCancelDeath\HCancelDeath.mdl
        For each (Integer LoopBombExplosion[1]) from 2 to (PowerupFire[1] + 1), do (Actions)
            Loop - Actions
                Set TempRegionA = (Region centered at BombExplosionPoint[LoopBombExplosion[1]] with size (140.00, 140.00))
                Set TempGroupA = (Units in TempRegionA matching (((Matching unit) is Undead) Equal to True))
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        (TempGroupA is empty) Equal to True
                    Then - Actions
                        Special Effect - Create a special effect at BombExplosionPoint[LoopBombExplosion[1]] using Objects\Spawnmodels\Human\HCancelDeath\HCancelDeath.mdl
                    Else - Actions
                        Custom script:   exitwhen true
                Custom script:   call RemoveRect( udg_TempRegionA )
                Custom script:   call DestroyGroup( udg_TempGroupA )
        For each (Integer LoopBombExplosion[1]) from 13 to (PowerupFire[1] + 13), do (Actions)
            Loop - Actions
                Set TempRegionA = (Region centered at BombExplosionPoint[LoopBombExplosion[1]] with size (140.00, 140.00))
                Set TempGroupA = (Units in TempRegionA matching (((Matching unit) is Undead) Equal to True))
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        (TempGroupA is empty) Equal to True
                    Then - Actions
                        Special Effect - Create a special effect at BombExplosionPoint[LoopBombExplosion[1]] using Objects\Spawnmodels\Human\HCancelDeath\HCancelDeath.mdl
                    Else - Actions
                        Custom script:   exitwhen true
                Custom script:   call RemoveRect( udg_TempRegionA )
                Custom script:   call DestroyGroup( udg_TempGroupA )
        For each (Integer LoopBombExplosion[1]) from 25 to (PowerupFire[1] + 25), do (Actions)
            Loop - Actions
                Set TempRegionA = (Region centered at BombExplosionPoint[LoopBombExplosion[1]] with size (140.00, 140.00))
                Set TempGroupA = (Units in TempRegionA matching (((Matching unit) is Undead) Equal to True))
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        (TempGroupA is empty) Equal to True
                    Then - Actions
                        Special Effect - Create a special effect at BombExplosionPoint[LoopBombExplosion[1]] using Objects\Spawnmodels\Human\HCancelDeath\HCancelDeath.mdl
                    Else - Actions
                        Custom script:   exitwhen true
                Custom script:   call RemoveRect( udg_TempRegionA )
                Custom script:   call DestroyGroup( udg_TempGroupA )
        For each (Integer LoopBombExplosion[1]) from 37 to (PowerupFire[1] + 37), do (Actions)
            Loop - Actions
                Set TempRegionA = (Region centered at BombExplosionPoint[LoopBombExplosion[1]] with size (140.00, 140.00))
                Set TempGroupA = (Units in TempRegionA matching (((Matching unit) is Undead) Equal to True))
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        (TempGroupA is empty) Equal to True
                    Then - Actions
                        Special Effect - Create a special effect at BombExplosionPoint[LoopBombExplosion[1]] using Objects\Spawnmodels\Human\HCancelDeath\HCancelDeath.mdl
                    Else - Actions
                        Custom script:   exitwhen true
                Custom script:   call RemoveRect( udg_TempRegionA )
                Custom script:   call DestroyGroup( udg_TempGroupA )
        For each (Integer LoopBombExplosion[1]) from 1 to 49, do (Actions)
            Loop - Actions
                Custom script:   call RemoveLocation( udg_BombExplosionPoint[udg_LoopBombExplosion[1]] )

i wanted to create 5 of those triggers (because of 5 players) and change the loop arrays etc, but when i tested the map all the special effect appered.

this is the trigger i used for testing MPI:

Code:
Events
    Player - Player 1 (Red) types a chat message containing 2 as An exact match
so the code lets every bomberman (= 5 different players) cast the channel ability. Another trigger places bombs for the certain player who casts this ability. and if those bombs explode the above mentioned trigger fires.

so is it MPI? i think it still causes those "double free of XXX" errors but is this a problem?

thanks in advance

+REP for useful comments
 

xxxtrickyxxx

(o Y o)
Reaction score
64
um, what exactly does this trigger do, just create an effect? I see no waits but alot of loops that I can not contemplate what they do. If the effect is instant, then there is no problem. Are those loops meant to just create a bigger more vibrant effect or are you trying to create one effect, then half a second later the next one appears? Clarify more and I think me or somoene may be able to help.
 

jnZ

I
Reaction score
64
you dont know bomberman? i just added the effects but i still have to add a unit -damage area line at every created special effect postition. its like the bomb at postition Y explodes and a explosion expands into N, W, E and S (X)

. . . . . . . . . . . . . X
. . . . . . . . . . . . . X
. . . . . . . . . . . . . X
. . . . . . . . . . . . . X
. . . . . . . . . . . . . X
. . . . . . . . . . . . . X
. . . . . . . .XXXXXX Y XXXXXX
. . . . . . . . . . . . . X
. . . . . . . . . . . . . X
. . . . . . . . . . . . . X
. . . . . . . . . . . . . X
. . . . . . . . . . . . . X
. . . . . . . . . . . . . X


so this is MPI even if all players cast at exactly the same time?
iam nearly 100% shure NewGen would give a "double free of location" error at the trigger when it runs at several time at exactly the same time. so this isnt a problem?

EDIT: the empty "undead" untigroup check, checks for "blocks" (undeads) in the explosion path and stops if true
 

jnZ

I
Reaction score
64
i just tested it a bit further and realized that the effects still are MPI (but i still dont know if it causes double free of location and if thats a problem) but i dont understand why it wont work with severeal unit of the same player. its the same if the trigger runs 4 times because of 4 different players or 4 times because 4 bombs of 1 player explode isnt it? but if i place 4 bombs in a chain an the damage causes a chain-reaction only sometimes all effects appear and sometimes only 1 explosion effects appear. i really dont get why

EDIT: oops sry double post i totaly forgot *slap myself*
 

demotry241

Don't Ever Categorize Yourself.
Reaction score
105
ahah...so you want chain reaction!, use statis trap

if the statis trap blows. all statis trap's in its aoe blows too. you just need to add... aoe explode on death(mines)

then just trigger.. unit dies= statis trap create special effect
 

jnZ

I
Reaction score
64
but the problem is: the chain reaction also appears over a certain distance (depends on the "firepower") for example A and B are bombs and the fire power is 3:

. . . .x . . . x
. . . .x . . . x
. . . .x . . . x
x x x A x x B x x x
. . . .x . . . x
. . . .x . . . x
. . . .x . . . x

so the effects (and the damage) also have to appear at locations where NO statis trap would be
 

demotry241

Don't Ever Categorize Yourself.
Reaction score
105
well... i tried.



-----------------------
hmmm let see..
create 1 point (caster position
create 4 points(north,east,west,south)
create 4 points again(offset of north,offset of east, offset of west, offset of south)


unit cast a spell

condition spell equal to time bomb

set caster position= position of caster..

set north offset = 200 of caster facing angle =90 degreess

set north = north offset
create dummy unit to position of north
order unit to dummy cast statis trap at north

well thats a prettty long trigger..
 

jnZ

I
Reaction score
64
uploaded the map for better understanding
 

Attachments

  • BOMB.w3x
    30.6 KB · Views: 83
General chit-chat
Help Users
  • No one is chatting at the moment.

      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