wc3campaigns
WC3C Homepage - www.wc3c.netUser Control Panel (Requires Log-In)Engage in discussions with other users and join contests in the WC3C forums!Read one of our many tutorials, ranging in difficulty from beginner to advanced!Show off your artistic talents in the WC3C Gallery!Download quality models, textures, spells (vJASS/JASS), systems, and scripts!Download maps that have passed through our rigorous approval process!

Go Back   Wc3C.net > Resources > Code Resources > Scripts
User Name
Password
Register Rules Get Hosted! Chat Pastebin FAQ and Rules Members List Calendar



Reply
 
Thread Tools Search this Thread
Old 06-06-2009, 06:33 AM   #1
grim001
requires vJass
 
grim001's Avatar


Code Moderator
 
Join Date: Nov 2006
Posts: 1,540

Submissions (10)

grim001 is just really nice (277)grim001 is just really nice (277)

Send a message via AIM to grim001
Default AutoEvents

Requires AutoIndex

AutoEvents is an add-on library for AutoIndex. It gives you events that detect the following things: when units resurrect, when units are raised with Animate Dead, when units begin reincarnating, when units finish reincarnatinging, and when transports load and unload units. It also provides other useful functions. You can check if a unit is currently raised with Animate Dead, get the transport carrying a unit, get the number of a units in a transport, get the passenger in a specific slot of a transport, and enumerate through all of the units in a transport.

Expand JASS:

Last edited by grim001 : 02-05-2010 at 06:08 PM.
grim001 is offline   Reply With Quote
Sponsored Links - Login to hide this ad!
Old 06-21-2009, 12:39 PM   #2
Anitarf
Procrastination Incarnate


Development Director
 
Join Date: Feb 2004
Posts: 8,190

Submissions (19)

Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)

2008 Spell olympics - Fire - SilverApproved Map: Old School Alliance TacticsHero Contest #2 - 3rd PlaceSpell making session 2 winner

Default

This has waited too long, approved.
__________________
Anitarf is offline   Reply With Quote
Old 06-22-2009, 03:08 PM   #3
grim001
requires vJass
 
grim001's Avatar


Code Moderator
 
Join Date: Nov 2006
Posts: 1,540

Submissions (10)

grim001 is just really nice (277)grim001 is just really nice (277)

Send a message via AIM to grim001
Default

Updated the thread to include both StatusEvents and TransportEvents, you can kill the other thread.

Also updated TransportEvents to include the function GetPassengerBySlot(transport, slot). Aside from the obvious point of getting the passenger in a specific slot of a transport, it enables a way to manually iterate through the units in a transport, as shown in a new example.

Last edited by grim001 : 06-22-2009 at 03:38 PM.
grim001 is offline   Reply With Quote
Old 07-22-2009, 05:03 PM   #4
ToukoAozaki
extends net.wc3c.Jasser
 
Join Date: Jun 2008
Posts: 336

Submissions (5)

ToukoAozaki will become famous soon enough (60)ToukoAozaki will become famous soon enough (60)ToukoAozaki will become famous soon enough (60)

Send a message via MSN to ToukoAozaki
Default

It would be great if this supports detecting the start/end of reincarnation... I really need that feature.

I've made something like below for workaround.

Expand JASS:

Last edited by ToukoAozaki : 07-22-2009 at 06:10 PM.
ToukoAozaki is offline   Reply With Quote
Old 07-23-2009, 08:06 AM   #5
grim001
requires vJass
 
grim001's Avatar


Code Moderator
 
Join Date: Nov 2006
Posts: 1,540

Submissions (10)

grim001 is just really nice (277)grim001 is just really nice (277)

Send a message via AIM to grim001
Default

I'll try to add support for that if you think it's useful. In a few days.
grim001 is offline   Reply With Quote
Old 07-30-2009, 11:42 PM   #6
Archmage Owenalacaster
Laughs Derisively
 
Archmage Owenalacaster's Avatar


Project Member: PoC
 
Join Date: Jun 2006
Posts: 649

Submissions (1)

Archmage Owenalacaster is a jewel in the rough (180)Archmage Owenalacaster is a jewel in the rough (180)Archmage Owenalacaster is a jewel in the rough (180)

Race-Building Contest #1 Winner

Default

I've encountered what may be a bug.

A creature that doesn't leave a corpse dies. The OnDeath callback is called. Then it completes its decay. The OnLeave callback is called and pops an error message.

AutoIndex error: Null unit passed to GetUnitId.

Both the callbacks call a struct.get method (implementing AutoData) to retrieve that unit's struct, so I think a null unit is being passed to it, when it shouldn't.

I've included a null-unit check in my script to compensate, but OnLeave should be called before the unit is actually removed, yes?
__________________
I enjoy small text.
Resources: Custom Race System
JademusSreg.950, North American region on StarCraft 2

Last edited by Archmage Owenalacaster : 07-30-2009 at 11:48 PM.
Archmage Owenalacaster is offline   Reply With Quote
Old 07-31-2009, 06:09 AM   #7
grim001
requires vJass
 
grim001's Avatar


Code Moderator
 
Join Date: Nov 2006
Posts: 1,540

Submissions (10)

grim001 is just really nice (277)grim001 is just really nice (277)

Send a message via AIM to grim001
Default

I'll check that out sometime soon.
grim001 is offline   Reply With Quote
Old 07-31-2009, 06:08 PM   #8
Archmage Owenalacaster
Laughs Derisively
 
Archmage Owenalacaster's Avatar


Project Member: PoC
 
Join Date: Jun 2006
Posts: 649

Submissions (1)

Archmage Owenalacaster is a jewel in the rough (180)Archmage Owenalacaster is a jewel in the rough (180)Archmage Owenalacaster is a jewel in the rough (180)

Race-Building Contest #1 Winner

Default

I've encountered a similar issue with OnUnload event callbacks, around which I have not yet found a compensatory measure.

EDIT: Regarding OnUnload event callbacks, I positioned a debug message call at the top of the callback, commented out the other content and tested. The error message occurs before my debug message, so this must also be a bug.

Units being issued on-orders for toggleable state abilities (Immolation, Mana Shield) OnEnter also pop the "filtered unit" error message. I've removed such abilities from units' initially activated ability field to compensate.

EDIT: It applies to any initially active ability, it seems; autocasts also popped the error.
__________________
I enjoy small text.
Resources: Custom Race System
JademusSreg.950, North American region on StarCraft 2

Last edited by Archmage Owenalacaster : 07-31-2009 at 10:09 PM.
Archmage Owenalacaster is offline   Reply With Quote
Old 08-16-2009, 08:07 PM   #9
Mr.Malte
User
 
Mr.Malte's Avatar
 
Join Date: Apr 2008
Posts: 286

Submissions (2)

Mr.Malte is on a distinguished road (11)

Default

This doesnt compile. It says, Ive got two macros of the same thing.
Both in your systems.
Mr.Malte is offline   Reply With Quote
Old 08-16-2009, 08:13 PM   #10
Archmage Owenalacaster
Laughs Derisively
 
Archmage Owenalacaster's Avatar


Project Member: PoC
 
Join Date: Jun 2006
Posts: 649

Submissions (1)

Archmage Owenalacaster is a jewel in the rough (180)Archmage Owenalacaster is a jewel in the rough (180)Archmage Owenalacaster is a jewel in the rough (180)

Race-Building Contest #1 Winner

Default

Quote:
Originally Posted by StatusEvents
Collapse JASS:
//===========================================================================
// How to install StatusEvents:
//==============================
//
// 1.) Copy and paste AutoIndex into your map and follow its directions.
// 2.) Modify the configuration section of AutoIndex as it instructs you to
//     to avoid compile errors.
Quote:
Originally Posted by AutoIndex
Collapse JASS:
//     If you add StatusEvents or TransportEvents to your map, you will need to modify
// the configuration section of AutoIndex. Unfortunately, this is the closest thing there
// is to conditional compiling right now. The final version of AutoIndex will be released
// once there is a prettier way to do conditional compiling.
//
//===========================================================================
// Configuration:
//================

//! textmacro RunStatusEvent takes EVENT
//! endtextmacro
//! textmacro RunStatusEventReverse takes EVENT
//! endtextmacro
//Disable the four lines above (remove the exclamations) if you are using StatusEvents.
//If you don't, you will get a "textmacro redeclared" compile error.
__________________
I enjoy small text.
Resources: Custom Race System
JademusSreg.950, North American region on StarCraft 2

Last edited by Archmage Owenalacaster : 08-16-2009 at 08:14 PM.
Archmage Owenalacaster is offline   Reply With Quote
Old 09-15-2009, 07:15 PM   #11
grim001
requires vJass
 
grim001's Avatar


Code Moderator
 
Join Date: Nov 2006
Posts: 1,540

Submissions (10)

grim001 is just really nice (277)grim001 is just really nice (277)

Send a message via AIM to grim001
Default

StatusEvents & TransportEvents both updated.
  • Added OnUnitReincarnationStart and OnUnitReincarnationEnd to StatusEvents. Credit to ToukoAozaki since I was inspired by his implementation.
  • Fixed the OnUnload null unit bug in TransportEvents. Thanks for pointing it out Ownalacaster.

Quote:
Originally Posted by Archmage Owenalacaster
Units being issued on-orders for toggleable state abilities (Immolation, Mana Shield) OnEnter also pop the "filtered unit" error message. I've removed such abilities from units' initially activated ability field to compensate.

EDIT: It applies to any initially active ability, it seems; autocasts also popped the error.
I just noticed this problem in the AutoIndex thread. You're using LastOrder, correct? You'll have to edit it or just avoid having AutoCast abilities turned on initially. Dusk will be making a new version of LastOrder soon that probably works around this issue.

Last edited by grim001 : 09-16-2009 at 03:58 AM.
grim001 is offline   Reply With Quote
Old 10-23-2009, 03:37 PM   #12
grim001
requires vJass
 
grim001's Avatar


Code Moderator
 
Join Date: Nov 2006
Posts: 1,540

Submissions (10)

grim001 is just really nice (277)grim001 is just really nice (277)

Send a message via AIM to grim001
Default

Updated.
  • Changed the syntax for registering functions, a boolean is no longer required, so it is not possible to un-register a function. The function will also run as many times as you register it. Anyway, it makes the code significantly shorter in both libraries.
  • Fixed a bug in StatusEvents where dying illusions could cause an AutoIndex error message in debug mode.
  • Documentation improvements for both libraries.

Last edited by grim001 : 10-24-2009 at 07:42 AM. Reason: Fixed a bbcode error
grim001 is offline   Reply With Quote
Old 10-24-2009, 04:10 PM   #13
grim001
requires vJass
 
grim001's Avatar


Code Moderator
 
Join Date: Nov 2006
Posts: 1,540

Submissions (10)

grim001 is just really nice (277)grim001 is just really nice (277)

Send a message via AIM to grim001
Default

Updated.
  • StatusEvents and TransportEvents have merged into one script.
  • Due to the fact that AutoIndex gained OnUnitIndexed and OnUnitDeindexed events, OnUnitEnter and OnUnitLeave no longer exist for StatusEvents.
  • Code and documentation changes.
grim001 is offline   Reply With Quote
Old 11-03-2009, 07:21 AM   #14
StealthOfKing
User
 
Join Date: May 2007
Posts: 19

StealthOfKing has little to show at this moment (0)

Default

There is one real flaw in using this method, that is native KillUnit takes unit whichUnit returns nothing on neutral aggressive player owned units.

Neither defend nor magicdefend are triggered if you KillUnit or SetWidgetLife(0). This exception only applies to neutral aggressive (creeps!), and is particularly hard to work around without some sort of KillUnit hook. I choose to use a replacement KillUnit function, the following will suffice and does correctly trigger neutral aggressive removal detection:
Collapse JASS:
function KillUnitEx takes unit u returns nothing
    call UnitDamageTarget(u, u, 999999, false, false, null, DAMAGE_TYPE_UNIVERSAL, null)
endfunction
StealthOfKing is offline   Reply With Quote
Old 11-03-2009, 04:11 PM   #15
grim001
requires vJass
 
grim001's Avatar


Code Moderator
 
Join Date: Nov 2006
Posts: 1,540

Submissions (10)

grim001 is just really nice (277)grim001 is just really nice (277)

Send a message via AIM to grim001
Default

OK, I've tested what you said. The problem is actually more specific. Units that are currently asleep won't issue undefend orders if they die. Any sort of damage wakes the unit up, so only non-damaging methods of killing the unit fail.

I've already updated AutoIndex (and by extension, this library) to fix the issue by detecting the death of Player(12) creeps and forcing the status update method to run. That way, no additional hook usage was required.
grim001 is offline   Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off


All times are GMT. The time now is 08:51 PM.


Affiliates
The Hubb The JASS Vault Clan WEnW Campaign Creations Clan CBS GamesModding Flixreel Videos

Powered by vBulletin (Copyright ©2000 - 2019, Jelsoft Enterprises Ltd).
Hosted by www.OICcam.com
IT Support and Services provided by Executive IT Services