Staredit Network

Staredit Network -> UMS Assistance -> Adding and Subtracting Unit HP
Report, edit, etc...Posted by TranNova on 2005-08-02 at 00:47:11
The map that i'm working on requiers that I subtract a unit's HP when a certain event happens.

Here's how I want it...


Trigger
Description:
A little ex...
Conditions:
¤ Player 1 brings 1 Terran Marine to Location 1
Actions:
¤ Subtract Terran Marine health by 10
¤ Wait 1000
¤ Preserve Trigger


The first action, sadly, doesn't exsist in normal staredit and that's what I need.

I know there's a Virtual HP system, but I don't think that can be used for a mass amount of units.

What I think needs to be done, but not completely sure, is that it finds the corresponding health varible of the unit, in this case a Marine. Then add or subtract the nessary value.
Report, edit, etc...Posted by darth_ender on 2005-08-02 at 00:54:28
Something I am working on at the present is when certain conditions are met, in your case the Marine goes to a certain location, you add 1 to an unused players score. Then, when the unused player score reaches a certain amount, you set the hp of your unit to a certain percent, in the case of a normal marine losing 10 points, set to 75%. That way, if the conditions are met again, you can add another point to custom score and set the marine's hp to 50% with another trigger. It takes an individual trigger for each point added and the setting of his hp. A problem with this is if he is already wounded, it could boost his hp back up, but it's the best I have to offer. Hope it helps.
Report, edit, etc...Posted by TranNova on 2005-08-02 at 01:02:16
Thanks for the reply...

Well I want to do this to a mass of units, so that way is good if I was doing a hero map (I may keep it in mind happy.gif ).

The only way really is if I can add/subtract directly the unit's Hp. Which would require going a bit past staredit I think. I have a general idea of what might need to be done. Hmm... makes me think, guess a little bit of research for me is at hand happy.gif .
Report, edit, etc...Posted by darth_ender on 2005-08-02 at 03:46:54
If you figure something good out, will you please tell me. I'm still learning these new triggers, and maybe what you're trying to do would help me with my aims. Good luck.
Report, edit, etc...Posted by RiShiN.rK on 2005-08-02 at 04:41:34
Your best bet is the EUD triggers. I'm not too sure exactly what they can do but heres the thread

http://www.staredit.net/index.php?showtopic=18147

You'll need this too. It gives you the triggers for what you wana do

http://homework.f2o.org/memcalcu.py

Good luck happy.gif
Report, edit, etc...Posted by Deathknight on 2005-08-02 at 10:36:39
METHOD 1:
To add, move the unit somewhere where a bunch of allied medics are- this will heal the unit- and move it back after X amount of time.

To subtract, move the unit somewhere where a bunch of invincible enemy attacking units are- this will damage the unit- and move it back after X amount of time.

METHOD 2:
This is for PC users only, and will only work for PC users- mac users will be unable to play your map.
Figure stuff out in the TRIGGERS OF GOD thread - there were things posted there about HP addition/subtraction/detection, or wait for uBeR@TiOn's trigger editor to be completed so you can click a couple of buttons and type in a number for HP addition/subtraction.
Report, edit, etc...Posted by darth_ender on 2005-08-03 at 01:30:45
Well, using memcalc I have managed to change the max level of hp. Like I said, I am actually needing to use something like this as well. I can't figure out how to change the hp within the max level. I think both TranNova and I could use a little help if anyone could offer some.

ADDITION:
Aha! I just figured out that if you set a unit's hp max down to a certain level and set it back to it's normal max, the hp level remains at the lower level.
i.e.
Zerg hatchery - 1250/1250
lower the health to 675/675
raise it up and voila! 675/1250
Use hyper triggers to do this and you won't even notice the decline in health max.
Report, edit, etc...Posted by Frozen-rpg on 2005-08-03 at 13:21:15
so are u saying u found a way 2 change a units max life in the game?
Report, edit, etc...Posted by ShadowBrood on 2005-08-03 at 13:24:30
Yup, it's kinda old now. Thankfully the hype died down.
Report, edit, etc...Posted by TranNova on 2005-08-04 at 21:11:57
I had a idea, I don't know how I can try this (i'm still new to this stuff).

Anyways, obvisuly when a unit attacks another unit the unit attacked loses HP. What if we had a unused unit, say a dragoon, and have it so the game thinks a dragoon attacked the unit we want to damage but no dragoon is there.

If you have you have 2 different triggers deducting the different amounts of damage then you just change the damage of the "dragoon" to whatever before it happens and have that attack simulated.


Trigger
Description:
What it may look like
Players:
¤ Player 1
Conditions:
¤ Player 1 brings at least 1 Terran Marine to Location 1
Actions:
¤ Change "Dragoon's" attack damage to 25
¤ Command "Dragoon" to attack all units at Location 1
¤ Eat a slice of pie happy.gif


The actions are fake but that what it may look like in meaning. If it's possible to do this there may be some bugs such as the "dragoon" only targeting one unit and attacking it too much. I've yet to try this but it may be possible.
Report, edit, etc...Posted by PCFredZ on 2005-08-04 at 23:36:28
QUOTE(TranNova @ Aug 4 2005, 09:11 PM)
I had a idea, I don't know how I can try this (i'm still new to this stuff).

Anyways, obvisuly when a unit attacks another unit the unit attacked loses HP. What if we had a unused unit, say a dragoon, and have it so the game thinks a dragoon attacked the unit we want to damage but no dragoon is there.

If you have you have 2 different triggers deducting the different amounts of damage then you just change the damage of the "dragoon" to whatever before it happens and have that attack simulated.








Trigger
Description:
What it may look like
Players:
¤ Player 1
Conditions:
¤ Player 1 brings at least 1 Terran Marine to Location 1
Actions:
¤ Change "Dragoon's" attack damage to 25
¤ Command "Dragoon" to attack all units at Location 1
¤ Eat a slice of pie  happy.gif


The actions are fake but that what it may look like in meaning. If it's possible to do this there may be some bugs such as the "dragoon" only targeting one unit and attacking it too much. I've yet to try this but it may be possible.
[right][snapback]279119[/snapback][/right]

The Attack order does not mean the Dragoon attacks what is at Location 1, it does an Attackto command TO the location. It's different than selecting it and right clicking on whatever unit is occupying Location 1. As long as the Dragoon player is unallied to P1 and the Dragoon is close enough it'll attack automatically anyway, so the Action is redundant.
Report, edit, etc...Posted by TranNova on 2005-08-05 at 00:21:22
Well the actall dragoon won't be there, put "it" will inflict damage to the unit in the location. I'm talking more like if there's a function that handles attacking like...

UnitAttack(Unit1, Damg1, Unit2, Damg2)

And it does stuff from there.
Next Page (1)