How to generate a random number as damage??

Get help using Construct 2

Post » Thu Nov 21, 2013 5:34 pm

Hi everyone I've just been working on a VERY basic turn based battle system (I'm still pretty new to this Construct 2 stuff) but I already have another question...

Can anyone give me an example or a method of how to generate random number as damage? Say I want it to be 4-8 vs just having an attack do 4 damage every time. I'm including my .capx file. Its NOT finished or anything just me messing with codes. on the event sheet, where it says subtract 4 from Monster.HP, what other code could I use to make it do 4-8 or something like that. 2-4, any random number? Thank you for any help or anyone that reads this!
B
3
Posts: 8
Reputation: 216

Post » Thu Nov 21, 2013 5:35 pm

<a href=http://www.filedropper.com/betterbattlesystemtest><img src=http://www.filedropper.com/download_button.png width=127 height=145 border=0/></a><br /><div style=font-size:9px;font-family:Arial, Helvetica, sans-serif;width:127px;font-color:#44a854;> <a href=http://www.filedropper.com >upload files online</a></div>
B
3
Posts: 8
Reputation: 216

Post » Thu Nov 21, 2013 5:35 pm

http://www.filedropper.com/betterbattlesystemtest my .capx
B
3
Posts: 8
Reputation: 216

Post » Thu Nov 21, 2013 5:43 pm

replace the 4 in the subtract with choose(4,5,6,7,8) or with floor(random(4,9))
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Thu Nov 21, 2013 6:02 pm

thank you :D
B
3
Posts: 8
Reputation: 216


Return to How do I....?

Who is online

Users browsing this forum: Kenthria, Mayfly and 13 guests