drop afther each -1000 hp

Get help using Construct 3!

Post » Wed Jul 12, 2017 5:17 pm

ok guys here is my problem
i have an asteroid of 50000 hp
now im mining him with mny laser but i want him to drop loots every -1000 hp ive reduced
how can i do it
http://www.twitch.tv/kiugetski
https://discord.gg/55R9Gbs

feel free to contact me of follow me :) i can give some advice
B
32
S
9
G
3
Posts: 145
Reputation: 3,895

Post » Wed Jul 12, 2017 10:05 pm

Add another instance variable to your asteroid object e.g. lootHP and set it to 1000
In the event that you deduct hp from the asteroid add an action to deduct the same from lootHP
Beneath that event add the sub-event : If asteroid.lootHP <=0 | asteroid spawn loot; asteroid set lootHP to 1000.
B
23
S
9
G
4
Posts: 507
Reputation: 4,431

Post » Thu Jul 13, 2017 6:05 am

+ Asteroid: Is overlapping BulletLaser


----+ Asteroid: Pick top instance
-----> Asteroid: Subtract random(​100​) from Hp
-----> Asteroid: Subtract random(​100​) from Hp


+ Asteroid: Hp ≤ 0
-> Asteroid: Destroy

// To add - for every -1000 hp of the asteroid make him drop loots
+ Asteroid: LootHp ≤ 0
-> System: Wait 0.01 seconds
-> Player: Spawn PowerUpsHP on layer "HPbar" (image point 0)
-> Asteroid: Set LootHp to 1000


its not working whats wrong
http://www.twitch.tv/kiugetski
https://discord.gg/55R9Gbs

feel free to contact me of follow me :) i can give some advice
B
32
S
9
G
3
Posts: 145
Reputation: 3,895

Post » Thu Jul 13, 2017 6:37 am

+ Asteroid: Pick top instance
-> Asteroid: Subtract 100​ from Hp
-> Asteroid: Subtract 100 from Hp

----+ Asteroid: LootHp ≤ 0
-----> Asteroid: Spawn PowerUpsHP on layer "HPbar" (image point 0)
-----> System: Wait 0.1 seconds
-----> Asteroid: Set LootHp to 1000

this one either none are working
http://www.twitch.tv/kiugetski
https://discord.gg/55R9Gbs

feel free to contact me of follow me :) i can give some advice
B
32
S
9
G
3
Posts: 145
Reputation: 3,895

Post » Thu Jul 13, 2017 8:16 am

kiugetski wrote:+ Asteroid: Is overlapping BulletLaser


----+ Asteroid: Pick top instance
-----> Asteroid: Subtract random(​100​) from Hp
-----> Asteroid: Subtract random(​100​) from Hp



+ Asteroid: Hp ≤ 0
-> Asteroid: Destroy

// To add - for every -1000 hp of the asteroid make him drop loots
+ Asteroid: LootHp ≤ 0
-> System: Wait 0.01 seconds
-> Player: Spawn PowerUpsHP on layer "HPbar" (image point 0)
-> Asteroid: Set LootHp to 1000


its not working whats wrong


You're subtracting from Hp twice (I guess you should once from Hp and once from LootHp).
One more thing is that you use "random" two times – so a different number will be subtracted from Hp than from LootHp.
B
32
S
7
G
4
Posts: 407
Reputation: 4,614

Post » Thu Jul 13, 2017 8:45 am

grigrizljac wrote:
kiugetski wrote:+ Asteroid: Is overlapping BulletLaser


----+ Asteroid: Pick top instance
-----> Asteroid: Subtract random(​100​) from Hp
-----> Asteroid: Subtract random(​100​) from Hp



+ Asteroid: Hp ≤ 0
-> Asteroid: Destroy

// To add - for every -1000 hp of the asteroid make him drop loots
+ Asteroid: LootHp ≤ 0
-> System: Wait 0.01 seconds
-> Player: Spawn PowerUpsHP on layer "HPbar" (image point 0)
-> Asteroid: Set LootHp to 1000


its not working whats wrong


You're subtracting from Hp twice (I guess you should once from Hp and once from LootHp).
One more thing is that you use "random" two times – so a different number will be subtracted from Hp than from LootHp.

^^^^^^^^^what he said
use a global variable called 'damage' and on the event say, set 'damage' to random(range), subtract 'damage' from HP, subtract 'damage' from Loot Hp
B
28
S
14
G
1
Posts: 148
Reputation: 3,218

Post » Thu Jul 13, 2017 8:48 am

you could then go a step further and before loot drop, set global variable 'luck' to random(range)
and then base your loot off of a random drawn number.
so as beating the 1st boss you would have a luck range (or loot class range) of 0-3, where as beating the 4th boss your luck can range from 7-15 etc depending how big your game is, even if its just a small game you can customize loot per level
B
28
S
14
G
1
Posts: 148
Reputation: 3,218

Post » Thu Jul 13, 2017 2:36 pm

awwww my bad ty XD
http://www.twitch.tv/kiugetski
https://discord.gg/55R9Gbs

feel free to contact me of follow me :) i can give some advice
B
32
S
9
G
3
Posts: 145
Reputation: 3,895


Return to How do I...?

Who is online

Users browsing this forum: No registered users and 2 guests

cron