Wc3C.net

Wc3C.net (http://www.wc3c.net/forums.php)
-   Samples (http://www.wc3c.net/forumdisplay.php?f=649)
-   -   Limited Summon (http://www.wc3c.net/showthread.php?t=104305)

Anitarf 01-28-2009 11:14 PM

Limited Summon
 
2 Attachment(s)
Allows you to limit the number of summoned units of a type that a single caster can summon. A very simple spell that is more of a template upon which more complex summon spells can be built.

Requires LinkedList and Table.
Expand Spell Code:

Rising_Dusk 01-28-2009 11:54 PM

I don't actually like the implementation at all, really. In order to implement, you copy and paste this as many times as you have summoning skills you need to limit. That isn't even considering that there may be more code associated with the nature of the summon to begin with.

I think being able to register a spell raw id to the system that is then monitored would be substantially more useful and more modular. call RegisterSummonedUnitLimit(SUMMON_ID, SUMMON_SPELL_ID, KillEffect, KillEffectPath, SummonLimit). The only disadvantage to this that I can see is the inability to have the SummonLimit depend upon skill level. I think function interfaces might be able to solve that issue, though, if I got anything out of Vex's tutorial. :)

If you keep it like this, though, I think the only section of the resource database it would make sense is "Samples."

akolyt0r 01-29-2009 12:26 AM

Quote:

Originally Posted by Rising_Dusk
I don't actually like the implementation at all, really. In order to implement, you copy and paste this as many times as you have summoning skills you need to limit. That isn't even considering that there may be more code associated with the nature of the summon to begin with.

...

If you keep it like this, though, I think the only section of the resource database it would make sense is "Samples."

Well i think that was anitarfs intention ...
Quote:

A very simple spell that is more of a template

Rising_Dusk 01-29-2009 01:54 PM

Doesn't mean I have to like it or find it useful in this form. :p

Vexorian 01-29-2009 03:13 PM

Quote:

I don't actually like the implementation at all, really. In order to implement, you copy and paste this as many times as you have summoning skills you need to limit. That isn't even considering that there may be more code associated with the nature of the summon to begin with.
And that's fine, isn't it?

Sure it could get into an actual system or stuff. But does it really have to?

Those structs must be private though.

Anitarf 01-29-2009 03:52 PM

Quote:

Originally Posted by Rising_Dusk
I don't actually like the implementation at all, really. In order to implement, you copy and paste this as many times as you have summoning skills you need to limit. That isn't even considering that there may be more code associated with the nature of the summon to begin with.

That's kind of the point, a summon spell could have other effects that could make use of these data structures so it's better that they're available to the spell coder than if they're locked up in a system, it also makes the whole thing more flexible since it can be edited more on an individual basis (like a single limit on multiple unit types etc.; such features would otherwise considerably bloat a general system). Furthermore, a map is likely to have few summon spells that need this sort of limitations, so there shouldn't be too much duplication of code.
Quote:

If you keep it like this, though, I think the only section of the resource database it would make sense is "Samples."
As it was intended.

Quote:

Originally Posted by Vexorian
Those structs must be private though.

Yikes, indeed. Fixed.

Rising_Dusk 01-29-2009 07:49 PM

Quote:

Originally Posted by Vexorian
Sure it could get into an actual system or stuff. But does it really have to?

Notice I didn't say anything about it having to be changed, I just think it's silly like it is.

Anyways, Vex didn't say anything else exciting, and it looks okay to me, so I am going to approve it as a sample.

ToukoAozaki 01-30-2009 02:39 AM

BTW if I implement such system, would it be approved? I just thought I could write a library in a way that would satisfy Dusk.

Rising_Dusk 01-30-2009 04:36 AM

I don't know, you'd basically just be copying his code with some wrapper overhead. It'd be kind of silly. Besides, I do see the use of having level-dependent summon counts. That's something you couldn't easily implement as a system. (Without some dumb struct based adjusting stuff)

Matarael 01-30-2009 11:23 AM

I haven't actually seen the uh... codes, but if this is what I think it is, I was really looking for a similar system (the one I finally made myself was a bit complicated and in GUI but it allowed for a level up in which more of the type of unit can be summoned at higher levels).

Would be great if someone made a simpler and better system for it.

fX_ 01-30-2009 12:51 PM

The discourses in submission threads are particularly amusing. The people work/talk on the script together.

ToukoAozaki 01-31-2009 12:08 PM

Quote:

Originally Posted by Rising_Dusk
I don't know, you'd basically just be copying his code with some wrapper overhead. It'd be kind of silly.


That might be true, as it would have some overhead for array lookup instead of constants. But I think this can be done with arrays and groups with functions, instead of structs; for this reason, I have little idea about performance difference.

Quote:

Besides, I do see the use of having level-dependent summon counts. That's something you couldn't easily implement as a system. (Without some dumb struct based adjusting stuff)
That only requires a single function interface for callback. :)


Still, I myself doubt writing a new one for this purpose would worth the efforts.

Anitarf 08-04-2009 11:09 PM

The map has been updated to work with Warcraft patch 1.24 (a simple matter of updating Table to 3.0, the spell code wasn't changed).


All times are GMT. The time now is 01:43 AM.

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