Weapon damage?

Get help using Construct 2

Post » Wed Feb 19, 2014 9:45 pm

Basically I would like to have more than just one sword, and i want sword #1 to do 1 dmg and sword #2 to do 2 dmg to every enemy and so on...
There wouldnt be any problem if i didnt have a bunch of enemies, so i want to know if there is a way to make damage on my swords without having to write conditions and events for each enemy and for each sword.
Thank you in advance.
B
7
S
2
Posts: 102
Reputation: 975

Post » Wed Feb 19, 2014 9:46 pm

Use instance variable for your swords and set dmg amount according to value of that variable
B
157
S
65
G
41
Posts: 2,594
Reputation: 34,748

Post » Wed Feb 19, 2014 9:53 pm

alrighty then, thanks for help.
B
7
S
2
Posts: 102
Reputation: 975

Post » Wed Feb 19, 2014 9:57 pm

I set up a system with global variables, example:

Global Variable - WeaponDamage = 0

(onEntity.hit) - SubtractFrom:Entity.Health(WeaponDamage + yourothervariables)

(OnPlayer.EquipWeapon) - Function("UpdateWeaponDamage")
OnCallFunction("UpdateWeaponDamage") - SetValue:WeaponDamage = (weaponyouequipped).Damage

The Damage in weaponyouequipped is an instance variable you decide for it.
B
6
S
2
Posts: 19
Reputation: 547


Return to How do I....?

Who is online

Users browsing this forum: alextro and 1 guest