+rep for little job

jnZ

I
Reaction score
64
can someone make me a working jass trigger for the following gui one:

Code:
Bomb Explosion
    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
        Unit - Cause (Triggering unit) to damage circular area after 0.00 seconds of radius 70.00 at BombExplosionPoint[1], dealing 10.00 damage of attack type Spells and damage type Magic
        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
                        Unit - Cause (Triggering unit) to damage circular area after 0.00 seconds of radius 70.00 at BombExplosionPoint[LoopBombExplosion[1]], dealing 10.00 damage of attack type Spells and damage type Magic
                    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
                        Unit - Cause (Triggering unit) to damage circular area after 0.00 seconds of radius 70.00 at BombExplosionPoint[LoopBombExplosion[1]], dealing 10.00 damage of attack type Spells and damage type Magic
                    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
                        Unit - Cause (Triggering unit) to damage circular area after 0.00 seconds of radius 70.00 at BombExplosionPoint[LoopBombExplosion[1]], dealing 10.00 damage of attack type Spells and damage type Magic
                    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
                        Unit - Cause (Triggering unit) to damage circular area after 0.00 seconds of radius 70.00 at BombExplosionPoint[LoopBombExplosion[1]], dealing 10.00 damage of attack type Spells and damage type Magic
                    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 dont know how to make it MUI because you cant use locals in loops in gui

the trigger creates everytime a unit of type bomb explodes a explosion that expands into North, east, south and west (explosion range depends on a firepower global integer)

people who know bomberman should know what i mean.

i dont know if this is hard or not however ill greatly +rep
 

jnZ

I
Reaction score
64
its not i tried it, if bombs explode in a chain reaction (2 or more next to each other) only SOMETIME all effects appear and sometimes only one

up to 5 player are able to place 10 bombs each > mean up to 50 bombs in a chain

like i said i tried it in my map and it didnt work well, i can upload it if you dont trust me
 
Reaction score
456
That's MUI, there are no waits.

Or.. no idea.. I can't read GUI well. I still think that the trigger you have there is MUI.
 

jnZ

I
Reaction score
64
attached the maps try the commands to increase firepower, bombamount etc to try chainreactions

try it if you dont believe me
 

Attachments

  • BOMB.w3x
    30.6 KB · Views: 151
M

Morfina

Guest
I haven't tried out your map. This is what I understood from the trigger, this should more or less do the same thing. A few notes:

1) This is untested
2) The trigger *should* be MUI. I see no reason for it not to be, at least.
3) I'm not 100% certain about what you expect PowerFire to be and such - From the way the trigger looks, it *seems* as if you expect it to be a number between 1 and 12 (+1, +13, +25, +37 to indexes). I decided to structure the loop so it was shorter, but I'm not sure if the method I've used coincides with how things are 'supposed' to look.
4) I don't create any regions at all. This is an actual difference from yours: You create regions 140 out from the bomb explosion points and select all units there. But I don't see the reason for that: The explosions are circular 70 yards out anyhow, and will hit units regardless of what regions you have or haven't created. Maybe I'm missing something? Its 02:55 in the morning, so theres definately a chance for that.
5) You're going to want to edit the filter function (Bomb_Explosion_Conditions) to use the correct unit ID integer. I just put 'N001' to ensure it compiled.
Anyhow. Untested, heres my tip:

Code:
(Removed - See 'latest' reply with the code in. No need to keep faulty code hanging around)
 

jnZ

I
Reaction score
64
tried to insert the trigger but couldnt get it to work, most likely because iam a insane noob at jass

take a look at the attached map (tried to insert the trigger there) and tell me what iam doing wrong pls

sry for double post but cant attach files if i edit my post
 

Attachments

  • BOMB.w3x
    30.7 KB · Views: 155

Ghostwind

o________o
Reaction score
172
Well even if the original is MUI, a jass trigger is always more efficient than a GUI one! :)
 
M

Morfina

Guest
Ah, I see what you're trying to do. Let me rework things a bit.
 

Tyman2007

Ya Rly >.
Reaction score
74
jnZ are you sure you checked to make sure if your not overrighting any point variables? look through it and remove some leaks before moving onto JASS with that.

Im looking and you didnt remove
BombExplosionPoint[1]
BombExplosionPoint[(LoopBombExplosion[1]+1)]
and all of the other additions to that variable.. like +13 +25 and +37

It also looks MUI.. Although if your going by 10 bombs per player its more MPI.
 
M

Morfina

Guest
Updated to work how you intended it. From my testing, seems to work fine.

Not sure on the lag, theres probably some optimization that can be done if this lags (Using pure coordinates instead of locations, f.ex). But in any case, this will be tons faster than GUI:

Code:
(Removed - See 'latest' reply with the code in. No need to keep faulty code hanging around)

I changed the function to use your GUI-declared PowerupFire variable instead of the one I declared in the example code I gave you. Remember that JASS-declared variables have no innate prefix, but any variable you declare in the GUI is prefixed with udg_ (user declared global) and gg_rct (global group rect? No clue) for Regions.

I also changed to 100 per block instead of 128, as that seemed to work better. Not at all bad looking effect, I might add. Makes me want to play Bomberman ;)
 

jnZ

I
Reaction score
64
oh thanks for reminding me to delete the leaks, tottaly forgot about it after it didnt work. and yes i know it looks mpi/mui whatever thats why i created it like this, but all i can say that sometimes only 1 effect appears if several bombs explode at exactly the same time due to a chain reaction.

maybe this is a problem with graphic settings? dunno

EDIT: used 128 because every single explosion (for every 1 firepower) should be effecting 1 medium grid and they are 128x128 arent they?

EDIT: do i need to have JassNewGen or another certain editor to get your trigger running? because if i exactly copy/paste the trigger it still gives about 7 error messages if i try to save and i cant test the map
 
M

Morfina

Guest
EDIT: used 128 because every single explosion (for every 1 firepower) should be effecting 1 medium grid and they are 128x128 arent they?

Yes they are, my bad. Use 128. That'd be the 2 in the morning thing kicking in.

As for chain reactions going bad, I don't see that happening - Blown up to 5 bombs at the same time with no explosions missing, with a flame of 5-6. With the code I just posted.
 

jnZ

I
Reaction score
64
do i need to have JassNewGen or another certain editor to get your trigger running? because if i exactly copy/paste the trigger it still gives about 7 error messages if i try to save and i cant test the map
 
M

Morfina

Guest
Most likely - I'm using the NewGen WE, and since I haven't ever been using the original WE I'm not sure what in the stuff I've written is NewGen specific.

I removed the globals because that might be it, and here's the map uploaded. This works 100% for me using the NewGen pack (with world editor 1.21, WC3 version 1.22).
 

jnZ

I
Reaction score
64
thanks ill get the newgen fix for 1.22 and try it

EDIT: everything works fine in your map but dude, iam really sorry i tottaly forgot about it till i checked your map, the reason iam using those regions is because the explosion should only appear if there is no "block" (classified as ancients) in my original trigger i used a empty unitgroup check for ancients in those regions and if they arent empty exit the loop.
maybe if you take a look at my original trigger youll understand better... iam really sorry ^^ could you edit that?

and btw the "70" in the damage part is it the radius?
 
M

Morfina

Guest
Ah, right. Yes, the 70 is the radius. For 128 size squares, if the explosion originates from the exact middle it should be 64 not 70 (Or you're going to overlap 8 pixels into the adjacent squares).

I'll see if I can't find an easier way to block explosions than creating a bunch of regions.
 
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