+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: 149
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: 151

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.
  • Varine Varine:
    How can you tell the difference between real traffic and indexing or AI generation bots?
  • The Helper The Helper:
    The bots will show up as users online in the forum software but they do not show up in my stats tracking. I am sure there are bots in the stats but the way alot of the bots treat the site do not show up on the stats
  • Varine Varine:
    I want to build a filtration system for my 3d printer, and that shit is so much more complicated than I thought it would be
  • Varine Varine:
    Apparently ABS emits styrene particulates which can be like .2 micrometers, which idk if the VOC detectors I have can even catch that
  • Varine Varine:
    Anyway I need to get some of those sensors and two air pressure sensors installed before an after the filters, which I need to figure out how to calculate the necessary pressure for and I have yet to find anything that tells me how to actually do that, just the cfm ratings
  • Varine Varine:
    And then I have to set up an arduino board to read those sensors, which I also don't know very much about but I have a whole bunch of crash course things for that
  • Varine Varine:
    These sensors are also a lot more than I thought they would be. Like 5 to 10 each, idk why but I assumed they would be like 2 dollars
  • Varine Varine:
    Another issue I'm learning is that a lot of the air quality sensors don't work at very high ambient temperatures. I'm planning on heating this enclosure to like 60C or so, and that's the upper limit of their functionality
  • Varine Varine:
    Although I don't know if I need to actually actively heat it or just let the plate and hotend bring the ambient temp to whatever it will, but even then I need to figure out an exfiltration for hot air. I think I kind of know what to do but it's still fucking confusing
  • The Helper The Helper:
    Maybe you could find some of that information from AC tech - like how they detect freon and such
  • Varine Varine:
    That's mostly what I've been looking at
  • Varine Varine:
    I don't think I'm dealing with quite the same pressures though, at the very least its a significantly smaller system. For the time being I'm just going to put together a quick scrubby box though and hope it works good enough to not make my house toxic
  • Varine Varine:
    I mean I don't use this enough to pose any significant danger I don't think, but I would still rather not be throwing styrene all over the air
  • The Helper The Helper:
    New dessert added to recipes Southern Pecan Praline Cake https://www.thehelper.net/threads/recipe-southern-pecan-praline-cake.193555/
  • The Helper The Helper:
    Another bot invasion 493 members online most of them bots that do not show up on stats
  • Varine Varine:
    I'm looking at a solid 378 guests, but 3 members. Of which two are me and VSNES. The third is unlisted, which makes me think its a ghost.
    +1
  • The Helper The Helper:
    Some members choose invisibility mode
    +1
  • The Helper The Helper:
    I bitch about Xenforo sometimes but it really is full featured you just have to really know what you are doing to get the most out of it.
  • The Helper The Helper:
    It is just not easy to fix styles and customize but it definitely can be done
  • The Helper The Helper:
    I do know this - xenforo dropped the ball by not keeping the vbulletin reputation comments as a feature. The loss of the Reputation comments data when we switched to Xenforo really was the death knell for the site when it came to all the users that left. I know I missed it so much and I got way less interested in the site when that feature was gone and I run the site.
  • Blackveiled Blackveiled:
    People love rep, lol
    +1
  • The Helper The Helper:
    The recipe today is Sloppy Joe Casserole - one of my faves LOL https://www.thehelper.net/threads/sloppy-joe-casserole-with-manwich.193585/
  • The Helper The Helper:
    Decided to put up a healthier type recipe to mix it up - Honey Garlic Shrimp Stir-Fry https://www.thehelper.net/threads/recipe-honey-garlic-shrimp-stir-fry.193595/

      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