What am I doing wrong?

PaladinHeart

New Member
Reaction score
3
Is Vista messing with me? Random triggers refuse to work. I dunno what to do..

Well here is the map. http://www.smurfdragon.com/buggedmap.zip

If I delete a bunch of the units then the map seems to work (there are about 210 units).

No matter what I do, this trigger doesn't want to work:

Code:
Corpse Death
    Events
        Unit - A unit Is attacked
    Conditions
    Actions
        Set GenGroup = (Units of type Corpse)
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                ((Attacked unit) is in GenGroup) Equal to True
            Then - Actions
                Set GenPoint = (Position of (Attacked unit))
                Unit - Create 1 Chicken for Neutral Victim at GenPoint facing Default building facing degrees
                Unit - Explode (Last created unit)
                Item - Create Blood at GenPoint
                Item - Create Bones at GenPoint
                Item - Create Entrails at GenPoint
                Item - Create Flesh Chunks at GenPoint
                Item - Create Heart at GenPoint
                Unit - Remove (Attacked unit) from the game
            Else - Actions
                Do nothing
        Custom script:   set bj_wantDestroyGroup = true
        Custom script:   call RemoveLocation (udg_GenPoint)

That trigger did work at some point in the past, randomly, but now it seems pretty much dead. >.<
 

Flare

Stops copies me!
Reaction score
662
can you actually atk corpses? or is the corpse an actual unit made to look like a corpse? also, please use code tags (the # icon right beside quote icon), its impossible to tell whats in/outside the if/then/else.

oh ye, change your custom script from call bj_wantdestroygroup to call DestroyGroup (udg_GenGroup). bj_wantdestroygroup is placed before you pick every unit in a unit group (i think) which you arent doing.
 

PaladinHeart

New Member
Reaction score
3
It's a unit. Sorry. I didn't know about the # thing. I'll see if I can fix it.

Hmm.. well while that avoids a memory leak issue, the trigger still doesn't work.
 

Grymlax

Probably not around
Reaction score
138
you don't need that if/then/else action. just check the unit-type of the attacking unit in the ordinary condition with a unit type comparison.
 

Flare

Stops copies me!
Reaction score
662
only unit groups, points and special effects leak as far as i know. just make a unit-type comparison as grymlax said in ur main conditions, and remove everything but what is inside the Then part of the If-Then-Else (put those actions OUTSIDE the if-then-else since you dont need that condition anymore, its already in main conditions) and keep the call RemoveLocation.

i cant copy-paste your code to show you what it shud look like :S and from what ive seen, Unit is in Group is a very awkward condition. i tried it before, and it didnt work at all
 

~GaLs~

† Ғσſ ŧħə ѕαĸε Φƒ ~Ğ䣚~ †
Reaction score
180
Why not
Code:
Corpse Death
    Events
        Unit - A unit Is attacked
    Conditions
	((Attacked unit) is Corpse) Equal to True
    Actions
        Unit - Explode (Attacked unit)
        Item - Create Blood at GenPoint
        Item - Create Bones at GenPoint
        Item - Create Entrails at GenPoint
        Item - Create Flesh Chunks at GenPoin
        Item - Create Heart at GenPoint
I didn't use GUI for long time, I just CnP your code and edit. Case letter may not same in Editor, but you got the idea.
 

PaladinHeart

New Member
Reaction score
3
Okay I made the changes suggested.

Code:
Corpse Death
    Events
        Unit - A unit Is attacked
    Conditions
        (Unit-type of (Attacked unit)) Equal to Corpse
    Actions
        Set GenPoint = (Position of (Attacked unit))
        Unit - Explode (Attacked unit)
        Item - Create Blood at GenPoint
        Item - Create Bones at GenPoint
        Item - Create Entrails at GenPoint
        Item - Create Flesh Chunks at GenPoint
        Item - Create Heart at GenPoint
        Custom script:   call RemoveLocation (udg_GenPoint)

The trigger looks nicer but it still doesn't work.
 

vypur85

Hibernate
Reaction score
803
Code:
Corpse Death
    Events
        Unit - A unit Is attacked
    Conditions
        (Unit-type of (Attacked unit)) Equal to Corpse
    Actions
        Set GenPoint = (Position of (Attacked unit))
        Item - Create Blood at GenPoint
        Item - Create Bones at GenPoint
        Item - Create Entrails at GenPoint
        Item - Create Flesh Chunks at GenPoint
        Item - Create Heart at GenPoint
        [B]Unit - Explode (Attacked unit)[/B]
        Custom script:   call RemoveLocation (udg_GenPoint)

The code seems workable. What about trying this instead? Just change the position. Or is it that you did not fulfill the condition? Is the Corpse the attacking unit or the triggering unit?
 

PaladinHeart

New Member
Reaction score
3
The corpse is the attacked unit. It's owned by neutral passive. I've tried giving it to both a hostile player and to player 1, but in both instances the corpse still does not explode but just dies a normal death after its life runs out.
 

~GaLs~

† Ғσſ ŧħə ѕαĸε Φƒ ~Ğ䣚~ †
Reaction score
180
Hey bro, I dl-ed your map and try testing it.
When it started, the map loading half way, then.. Poof! Fatal Error.
 

PaladinHeart

New Member
Reaction score
3
Thanks for trying to load it. Maybe it's been corrupted somehow?

I just wish I knew the source of the problem.. >.<

I just tried downloading it, and extracted it, and World Editor loads it fine for me. Heh. Maybe there's something wrong with my world editor? How would I go about re-installing it? (without having to re-install the whole game)
 

PaladinHeart

New Member
Reaction score
3
I found the culprit. Actually I had two large arrays.

culprit.jpg
 
General chit-chat
Help Users

      The Helper Discord

      Staff online

      • Ghan
        Administrator - Servers are fun

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top