W3 System Question

A place to talk about general WC3 and EotA related stuff.
Post Reply
Message
Author
User avatar
Perhaps
Retired
Retired
Posts: 811
Joined: September 14th, 2007, 1:24 am
Contact:

W3 System Question

#1 Post by Perhaps »

So... When a hero dies, and it comes back it'll have the items that it died with, unless the items are dropped. My question is, if a non-hero carries an undroppable item, and dies. Will the the item(s) remain in memory?

I ask this because I want to give item capabilities for army units, most specifically potions. One problem, not critical, but I'd like to prevent is accidental giving to units items (most probable situation, passing to another player) by having the slots never be empty, by having the potions be undroppable perminents with a quantity, so that there's an item still, when the quantity is used up. Undroppable so that there's not a mess of items in the playing field. I could use triggers (using structures which 'Something' is zealous about wanting me to use), however I'd like to keep down need for triggers as much as possible.
Image

User avatar
DarnYak
Site Admin
Site Admin
Posts: 2364
Joined: August 12th, 2006, 2:54 pm

Re: W3 System Question

#2 Post by DarnYak »

I dont know offhand. Only thing I think i remember is in the inventory ability there's an auto drop on death option. Aside from that, try it yourself, it shouldn't take more then 5 mins to take a test.

DarnYak

User avatar
Perhaps
Retired
Retired
Posts: 811
Joined: September 14th, 2007, 1:24 am
Contact:

Re: W3 System Question

#3 Post by Perhaps »

How do I test to if it's item is still in memory when it's on a unit that will be taken out of memory when it dies? The only thing I could possibly think of is to run a script to spawn a unit with a non-dropable item on it, then kill it, and have it loop like 5000 times and see if my paging files jacked up. Other than that, any other ideas?

By the way, what do you do to create the effect of a tree regrowing after it dies? Including sprouting in the tree's death animation, an effect/animation, or just something I don't know exists?

And one last question, do you use these things 'Something' mentions of to me often, called structures, for EotA? Based on what he says, they seem like what I'd want to use for trigger efficiency and a more organised format.
Image

User avatar
DarnYak
Site Admin
Site Admin
Posts: 2364
Joined: August 12th, 2006, 2:54 pm

Re: W3 System Question

#4 Post by DarnYak »

Perhaps wrote:How do I test to if it's item is still in memory when it's on a unit that will be taken out of memory when it dies? The only thing I could possibly think of is to run a script to spawn a unit with a non-dropable item on it, then kill it, and have it loop like 5000 times and see if my paging files jacked up. Other than that, any other ideas?
That's one basic way, another I believe would be to kill a unit with an item, wait till it decays, and then try to manipulate the item after a minute or two. (Move it, display item details like name, etc.)
By the way, what do you do to create the effect of a tree regrowing after it dies? Including sprouting in the tree's death animation, an effect/animation, or just something I don't know exists?
This was in one of the other threads. I don't recall having to do anything special for the animation.
And one last question, do you use these things 'Something' mentions of to me often, called structures, for EotA? Based on what he says, they seem like what I'd want to use for trigger efficiency and a more organised format.
They're much easier to use then most the crap I do, but they don't really exist in wc3. They add overhead that can be marginal or significan depending on the situation. However, I don't use them becuase due to the fact that they're just emulated, I can't fully trust what the actaly code would be doing, and that's not something i feel like fucking around with in jass. I would maybe consider switching for an EotA2 (were it to ever exist), but I'm not at that point.

Just to make it clear what vjass (or whatever its called) does, take this for example. (this is an example, not nessarily exaclty how it works)

Code: Select all

box b = new box
b.x = 5
Would be how you write something. vjass changes this to

Code: Select all

int b = Box_New()
set Box_x[b] = 5
Which is what wc3 understands and executes. In this small example the differences are minor (very little is being done), and at the same time nothing is like the original code. If this were just renaming (which a large part of it is) I wouldn't be concerned by it, but the bigger probelm is that wc3 doesnt' support dynamic allocation, nor structures, and thus they get emulated by series of arrays.

DarnYak

Post Reply