HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Shield System

02-17-2006, 12:04 AM#1
shadow1500
A system that allows you to create/remove shields, the shields can have an regeneration and armor value (in percentege).
UPDATE 1.1: Added credit, fixed leaks.
UPDATE 1.2: Added function CreateShieldEx with 2 arguments - shield color and damage spill option, also fixed problem with armor also blocking the damage spill.
Attached Images
File type: jpgShieldSystem.jpg (87.3 KB)
Attached Files
File type: w3xShield System 1.2.w3x (28.5 KB)
02-17-2006, 12:32 AM#2
Blade.dk
This seems like a good and interesting system, you will need to update something before I can approve it though.

First of all, you are using KaTTaNa's Local Handle Variables functions. You need to give him credit for his work, else I can't approve this.

Second, you will need to do something like call FlushGameCache(InitGameCache("localvars.w3v")) before initializing the cache, else it can cause problems. Read more here: http://www.wc3jass.com/viewtopic.php?t=2334.

Also, you have a few locals-not-set-to-null leaks (texttags), you should better fix that.
02-17-2006, 12:38 AM#3
shadow1500
oops srry, i modified my old spell and forgot to update those things, gona do it now.
02-17-2006, 07:53 AM#4
Blade.dk
No problem, glad you updated it.

Approved.
02-17-2006, 12:15 PM#5
BertTheJasser
Some time ago I've read something about texttag. They told me thtat texttags don't leak as long as they are timed. I guess this is true.
02-17-2006, 02:09 PM#6
Fulla
Simply amasing and exactly what I needed :-)
02-17-2006, 02:49 PM#7
shadow1500
Quote:
Originally Posted by BertTheJasser
Some time ago I've read something about texttag. They told me thtat texttags don't leak as long as they are timed. I guess this is true.
This is true, but what does this has to do with this spell? The lifebars are permenant in this spell.
I was actually planning to make a lifebar model with 20 anims to reduce lag and to get rid of the 100 texttag limitiation, but now that this is 100% JASS its less laggy than the last version.
02-17-2006, 04:29 PM#8
Vexorian
Quote:
Originally Posted by BertTheJasser
Some time ago I've read something about texttag. They told me thtat texttags don't leak as long as they are timed. I guess this is true.
yeah but local variables that point to them still have to get set to null
02-17-2006, 05:22 PM#9
Joey.
On your screenshot, I'm not certain you included the 50% shield armor. Either way this is definately usefull - perhaps a Bone Armor.
02-17-2006, 07:55 PM#10
shadow1500
Quote:
Originally Posted by Joey.
On your screenshot, I'm not certain you included the 50% shield armor. Either way this is definately usefull - perhaps a Bone Armor.
It says
Quote:
Damage=400
After Armor=200
so yea its included.
02-17-2006, 08:03 PM#11
Anitarf
But this armour then also reduces the damage that spills over the shield, which it shouldn't; or at least make it toggleable. What's the point of having armour, couldn't you just have a twice as powerful shield instead of a 50% reduction? Could also use some more customization, like enabling/disabling spill (does the attack that kills the shield also do damage to the unit or is the extra damage lost), and other such stuff; it would be enat if the system could be used to make more than one different type of shields.

Just some thoughts for any future versions you might make.
02-17-2006, 08:14 PM#12
shadow1500
Quote:
What's the point of having armour, couldn't you just have a twice as powerful shield instead of a 50% reduction?
Well, Fulla requested that i add armor, u dont have to use it.
Quote:
Could also use some more customization, like enabling/disabling spill (does the attack that kills the shield also do damage to the unit or is the extra damage lost)
i dont think anyone will want such a feature, it would be extremly unbalanced, if sum1 casts an ability that does 500 damage and the shield life is like 10, then the spell would deal no damage.
Quote:
it would be enat if the system could be used to make more than one different type of shields.
how can i make different types?
Quote:
But this armour then also reduces the damage that spills over the shield
ill change that
02-17-2006, 09:26 PM#13
Anitarf
Quote:
Originally Posted by shadow1500
i dont think anyone will want such a feature, it would be extremly unbalanced, if sum1 casts an ability that does 500 damage and the shield life is like 10, then the spell would deal no damage.
Well, that depends on the type of map and what gameplay mechanics the user of the system want to have. For me, it's an interesting twist, promotes smart use of spells.

Quote:
how can i make different types?
Well, I meant that the system would be a generic template for making shields that could be customized to make shields that work in diferent ways, depending on how the mapmaker would like them to work. Ideally, you could make different kinds of shields in the same map, allowing one unit to have any number of layers of shields. For example, in a map, some units would have some normal regenerating shields by default, but there would also be a buffing spell that would create a small deflective shield with different parameters (for example, no regeneration, but better armour and no damage spill) on a target unit, on top of any shields it might already have.
02-17-2006, 10:23 PM#14
shadow1500
Quote:
Well, I meant that the system would be a generic template for making shields that could be customized to make shields that work in diferent ways, depending on how the mapmaker would like them to work.
Then there's no need for a system, all the user has to do is to get a generic "unit is damaged" event and the DamageModify function and then he has full control on how the shield works.
Quote:
Ideally, you could make different kinds of shields in the same map, allowing one unit to have any number of layers of shields.
Thats not a good idea, maybe max 2 shields on a unit, with a main shield which will have first piriority, and a secondary shield which will take over if the main shield depletes, because more shields=more bars=more lag.
Quote:
Well, that depends on the type of map and what gameplay mechanics the user of the system want to have. For me, it's an interesting twist, promotes smart use of spells.
Add a new boolean handle var, change the BlockDamage trigger - in the "if dmg>slife" part, make an if statment that says that if that boolean handlevar is true then it will use DamageModify(u,dmg,0) instead of the DamageModify that was there.
02-18-2006, 08:11 AM#15
Anitarf
Quote:
Originally Posted by shadow1500
Then there's no need for a system, all the user has to do is to get a generic "unit is damaged" event and the DamageModify function and then he has full control on how the shield works.
The user could also just code his own system. The point is that this saves him some work.

Quote:
Thats not a good idea, maybe max 2 shields on a unit, with a main shield which will have first piriority, and a secondary shield which will take over if the main shield depletes, because more shields=more bars=more lag.
You could only display the topmost shield, or only display shields for selected units, or whatever. If a player has only a few uits in the map, why not allow them to be able to have up to 3 shields (or more)?

Quote:
Add a new boolean handle var, change the BlockDamage trigger - in the "if dmg>slife" part, make an if statment that says that if that boolean handlevar is true then it will use DamageModify(u,dmg,0) instead of the DamageModify that was there.
Well, it's your system, not mine. The point of a system is that a user shouldn't have to worry about how it works internally, just use it.