Archived copy of war3source.com, the War3Source forum (2009–2020), rebuilt from the Internet Archive by wc3mods.net. This page was captured on 2012-10-25 (original capture). Forum · All archived topics · Wiki · Bug tracker · Blog
Chat

War3:Source
October 24, 2012, 10:54:17 PM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Download: http://war3source.com/index.php?board=9.0
What is War3Source?: http://war3source.com/index.php?topic=200.0
Sample Stats: http://war3source.com/war3stats
Steam Community Group: http://steamcommunity.com/groups/war3source
War3Source SVN Checkout: http://ownageclan.com/svn/war3source/
War3Source servers: http://www.game-monitor.com/search.php?vars=war3_version=
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Check items in OnWar3EventDeath  (Read 479 times)
Glider⠠⠵
Global Moderator
Sr. Member
*****
Posts: 413


⠠⠵


View Profile
« on: January 04, 2011, 10:02:17 AM »

I was messing around with a snippet that looped through all items loaded in the death event and checked if the player had a specific item, then executed some code. I later moved this to a race but every check returned False.

Code:
// Iterate over all possible items
for(new x=1;x<=W3GetItemsLoaded();x++)
{
// Victim has item x
if(War3_GetOwnsItem(victim, x))

Naturally this is because this time my plugin was executed after the shopmenu aswell as the custom item plugins so they all already removed the item before I could check. Is there any simple way around this? I thought of running a timer that repeats itself each 0.1 seconds and just writes all the items of each player into an array. Any other method?
Logged

Ownz
Developer
Administrator
Hero Member
*****
Posts: 2046



View Profile WWW Email
« Reply #1 on: January 04, 2011, 11:21:30 AM »

some sort of prehook implemented in the main

what kind of items are u thinking of?
Logged

DarkEnergy
qwerty
Jr. Member
**
Posts: 87


View Profile
« Reply #2 on: January 04, 2011, 11:45:22 AM »

are you thinking of some sort of blow-up-baby-doll item, that explodes when you die?
Logged
Glider⠠⠵
Global Moderator
Sr. Member
*****
Posts: 413


⠠⠵


View Profile
« Reply #3 on: January 04, 2011, 11:46:01 AM »

@Ownz: Right now every single one, default and custom ones.
@querty: No, I would put that code into the items code.
Logged

Ownz
Developer
Administrator
Hero Member
*****
Posts: 2046



View Profile WWW Email
« Reply #4 on: January 04, 2011, 11:47:38 AM »

i dont understand what u said fox

if u make ur OWN item, it is not removed automatically. other items plugins manually remove them on death
Logged

DarkEnergy
Glider⠠⠵
Global Moderator
Sr. Member
*****
Posts: 413


⠠⠵


View Profile
« Reply #5 on: January 04, 2011, 11:49:09 AM »

Nono, I'm making a race wich has a kind of item steal ability. When it kills someone I need to know what items they were holding so I can snatch one.
Logged

Ownz
Developer
Administrator
Hero Member
*****
Posts: 2046



View Profile WWW Email
« Reply #6 on: January 04, 2011, 11:49:55 AM »

lol there is such a race in warcraft?
Logged

DarkEnergy
Glider⠠⠵
Global Moderator
Sr. Member
*****
Posts: 413


⠠⠵


View Profile
« Reply #7 on: January 04, 2011, 11:56:17 AM »

 Roll Eyes So is there a better way than updating an array or not?
Logged

Ownz
Developer
Administrator
Hero Member
*****
Posts: 2046



View Profile WWW Email
« Reply #8 on: January 04, 2011, 11:58:59 AM »

yes ill make a PRE w3 event  , hold ur horses and wait for me to die in class </sarcasm>
Logged

DarkEnergy
Ownz
Developer
Administrator
Hero Member
*****
Posts: 2046



View Profile WWW Email
« Reply #9 on: January 04, 2011, 12:08:33 PM »

W3Event

OnDeathPre, //EventArg1 = attacker.  before w3 actual death forward is called to do some reading ( ie before items are lost)
}


next version
Logged

DarkEnergy
Glider⠠⠵
Global Moderator
Sr. Member
*****
Posts: 413


⠠⠵


View Profile
« Reply #10 on: January 04, 2011, 12:09:27 PM »

Much appreciated
Logged

qwerty
Jr. Member
**
Posts: 87


View Profile
« Reply #11 on: January 04, 2011, 09:39:31 PM »

lol there is such a race in warcraft?

does there have to be?
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!