Damage Display [SOLVED>PROBLEM WITH AZU]

For questions about using Classic.

Post » Tue Jun 14, 2011 8:20 pm

[quote:2ll78eyg]Left(string, N)
Returns a string with the left N characters of string, eg. Left("Hello", 2) gives "He" [/quote:2ll78eyg]

That with a few subevents should work.
-if damage is greater than 1000 set text to left(variable "damage",3)&" k"
--if damage is greater than 1000000 set text to left(variable "damage",9)&" m"
Image Image
B
161
S
48
G
91
Posts: 7,358
Reputation: 67,271

Post » Tue Jun 14, 2011 9:37 pm

Would that only worked with text-base numbers instead of sprite-based ones?
B
11
S
3
G
8
Posts: 473
Reputation: 4,569

Post » Tue Jun 14, 2011 11:11 pm

The text object is pretty good about doing the conversion, but you can always use str(), or int(), if need be.
Image Image
B
161
S
48
G
91
Posts: 7,358
Reputation: 67,271

Post » Tue Jun 14, 2011 11:42 pm

What using sprite-based ones? Like in the example in this thread.
B
11
S
3
G
8
Posts: 473
Reputation: 4,569

Post » Tue Jun 14, 2011 11:59 pm

That would be the variable, like:
If round(((Hero.Value('Power')*1.2)-Enemy.Value('Resist')+random(15))*global('Factor'))+1 is greater than 1000000
Set your sprites to
left(str(round(((Hero.Value('Power')*1.2)-Enemy.Value('Resist')+random(15))*global('Factor'))+1),9))&" M"
Or what ever your using for m.
Image Image
B
161
S
48
G
91
Posts: 7,358
Reputation: 67,271

Post » Wed Jun 15, 2011 12:41 am

Must be doing something wrong.

I'm not understanding much. I'm not using text in any fashion.
Look in stats for the damage stuff.

Baddies and Bosses for the damage dealing
http://dl.dropbox.com/u/32409323/engine2a.cap
B
11
S
3
G
8
Posts: 473
Reputation: 4,569

Post » Wed Jun 15, 2011 1:21 am

Sorry I cant seem to open your cap. Its pretty odd It says the cap uses "Colored Outline. Fx", and cant be located, but I clearly have the fx, and it's working for me.
I guess either you version is different, or mine is corrupt somehow.
Either way I mean use the value you use to set the frames. Strings are usually converted.
I was just using the text object as an example.
Image Image
B
161
S
48
G
91
Posts: 7,358
Reputation: 67,271

Post » Wed Jun 15, 2011 2:28 am

Oh, I just renamed "Colour" to "Color". You must have the one with the original name.

<--American.
B
11
S
3
G
8
Posts: 473
Reputation: 4,569

Previous

Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 4 guests