Switching health font mid-game

Have any questions or problems in making your game, subscribing and/or using our software? Post here.
Forum rules
Make sure you are using the newest version. This can be downloaded at the top of the site via the "downloads" link.

Use a very good subject. "Problem" or "Help" are unacceptable titles.

Use the search feature before posting a question, as the answer is probably already here.

Subscript out of range error 9: This is a generic error, and we'll need way more information than that to figure out the problem. If you get this, strongly consider following the instructions of submitting your project through the Submit Bug feature within the editor.
fma_lvr
001 Subscriber
 
Joined: Wed Sep 15, 2010 5:02 am

Switching health font mid-game

Postby fma_lvr » Mon Jan 18, 2016 10:31 pm

I'm not sure how to word this, but I want to change the font associated with damage numbers under certain circumstances. However, I couldn't find anything in the interfaces or settings that specifically stated that 'health font' was to be used for the numbers that pop up. I figured I could just change the font associated with a field, but I don't know which field I would have to change. Is this hidden deep within the code, or have I simply missed it?

User avatar
Gamerdude
001 Support
 
Joined: Wed Dec 12, 2007 8:56 pm
Location: Australia

Re: Switching health font mid-game

Postby Gamerdude » Mon Jan 18, 2016 11:22 pm

If you go to Fonts, you'll see one font is called Health Font. That's the damage numbers font. It cannot be changed mid-game unfortunately. You may need to set up your own damage number system.
Image
Image

fma_lvr
001 Subscriber
 
Joined: Wed Sep 15, 2010 5:02 am

Re: Switching health font mid-game

Postby fma_lvr » Sun Jan 24, 2016 5:13 am

Yeah, but how do I do that? I mean, I already created a custom damage formula, but I don't know how to change anything regarding the numbers that pop up.

User avatar
Gamerdude
001 Support
 
Joined: Wed Dec 12, 2007 8:56 pm
Location: Australia

Re: Switching health font mid-game

Postby Gamerdude » Sun Jan 24, 2016 6:24 am

You'd have to set up an interface to be used as a Character interface, that spawns a field and moves it every time an actor is damaged. The field will contain the amount of damage they received. You'll have to be careful that the fields relate only to the one actor so that in the off chance that two actors are damaged at the same time, the fields don't both have the same values.
Image
Image

fma_lvr
001 Subscriber
 
Joined: Wed Sep 15, 2010 5:02 am

Re: Switching health font mid-game

Postby fma_lvr » Tue Mar 08, 2016 1:41 am

Could I see a script for such a field, please? I haven't really messed with fields yet personally, and I'm not really sure how to do what you suggested.

User avatar
Gamerdude
001 Support
 
Joined: Wed Dec 12, 2007 8:56 pm
Location: Australia

Re: Switching health font mid-game

Postby Gamerdude » Fri Mar 18, 2016 10:49 pm

Sorry, I keep forgetting to reply to this.

I haven't done it myself, but here's what should be possible:

1. Create an interface (or use the existing Character HUD interface) that is attached to actors. Have a field that will represent your damage number.
2. In the "Attacked" trigger of the Actor template, add events that spawns a new field based on the damage number field, change the value of newly spawned field to the damage that was calculated by this script (may need to save it to a variable so the damage dealt and the damage represented by the variable are the same), positions that field upwards over a period of time (or any animation you want it to perform), then changes its existence or fades it out.
Image
Image


Return to Technical Support Questions

Who is online

Users browsing this forum: No registered users

cron