Giving HP to an actor?
So i have an actor that is moved just by the arrow keys. He currently has a tool that allows him to destroy a particular obstacle by touching it. I would like just one collision to remove 1HP from the obstacle, and press the arrow key in the direction of the obstacle in order remove an additional HP.
MY HP value is also not working.
I would also like there to be a small time lag in between each hit, so i can leave room for my hit animation.
Does this make any sense to anyone? : D
Thanks in advance!
MY HP value is also not working.
I would also like there to be a small time lag in between each hit, so i can leave room for my hit animation.
Does this make any sense to anyone? : D
Thanks in advance!
Comments
How do i give an actor and HP attribute, and then use something like a sword to remove HP?
No matter what i do, i can neither deal damage, or make the actor appear.
Right now i have HP set as an attribute... i want to give the actor 3 HP, i have a weapon that i want to remove only 1 HP at a time. Each time the actor looses HP, i want to change them to a different image. Right now i have the weapon overlapping with the actor when i press the action key. I just want to be able to make the actor lose HP when it's overlapping, without destroying it right away.
Thanks!
Thanks!
I have a rule that when actor overlaps or collides with the equipped weapon, it will:
change attribute to (game.HP-1)
and when HP = 0, then the actor(enemy) is destroyed...
I still cannot get this to work : /
So have a rule when it overlaps or collides with whatver
change attribute self.HP to self.HP-1
then make another rule when attribute self.HP is equal to or less then 0
destory actor
dont put the brackets around the attributge either, and make sure your selecting from the drop down menu
i put:
Rule:
Actor overlaps or collides with Weapon,
and Weapon is equipped,
Change Attribute: Self.HP to Self.HP-1
Rule: When Self.HP is equal to or less than 0,
Destroy this actor
HP is set to 0 in both game and scene attributes.. and the actor has an HP attribute of 3.
I've tried all the combinations i can think of with this, and it's still not working.
Email me at matthewredler@gmail.com
I appreciate your efforts, however i'd still like to see if anyone else has any ideas.
Thanks!
Rule:
When Actor overlaps or collides with Weapon,
and Weapon is equipped, (I'm guessing this is an attribute here)
and HP > 0
Change Attribute: Self.HP to Self.HP-1
otherwise
Destroy this actor
""You are in a maze of twisty passages, all alike." - Zork temp domain http://spidergriffin.wix.com/alphaghostapps
Though that just made all the enemies dissapear : D
It's a bit late (or should I say a bit early) here in the UK, so I'll have another think after sleep - although hopefully your prob. will be solved by then by someone else... sorry I couldn't help more at the moment. :-(
""You are in a maze of twisty passages, all alike." - Zork temp domain http://spidergriffin.wix.com/alphaghostapps
http://soylentworks.com/salad/hpees.png
Add another rule that says 'if self.hp is less than or equal to 0'
Destroy actor.
That should do it.
Cheers,
QS
Edit - to clarify, what you had going on was a rule saying if you're being hit by a pickaxe and your HP is more than 0, then reduce hp by 1.
The 'Otherwise' section with just 'destroy' in it essentially was destroying your actor if it *wasn't* being hit by a pickaxe - i.e. all the time!
Dr. Sam Beckett never returned home...
Twitter: https://twitter.com/Quantum_Sheep
Web: https://quantumsheep.itch.io
However, although now i cannot destroy it again... it's as if the HP attribute isn't working... or i am missing something retarded...
So:
If pickaxe is used
and hits enemey
Timer: After .1 seconds
change self.hp to self.hp -1
See if that helps?
QS
Edit - also, add a separate display behaviour to show the self.hp of the actor - then you can see if it's changing at all.
Dr. Sam Beckett never returned home...
Twitter: https://twitter.com/Quantum_Sheep
Web: https://quantumsheep.itch.io
Skype: ozboybrian
Well i figured out a way to do it... i am making it collide with the player vs. the weapon.... which is weird... but it works.
Ship it!
Thanks guys!