INI files

For questions about using Classic.

Post » Fri Jan 22, 2010 6:07 pm

After reviewing the changes I see that you added:

Always (every tick) INI.ItemValue("TimeTrial", "Time") & " by " & INI.ItemString("TimeTrial", "Name")

to my first layout page. So that is what I was missing?

I am confused why you need an always here. I can see Always point my gun at the mouse but why for data?

It was suggested that I have an Include Event Sheet: Layout 1 events on my layout 2, it now seem that I can remove that with no problem at all. Your fix still works.

1. Why do I need the Always on layout 1
2. Is there a good write up some where about Always
3. When do you use "Include Event Sheet" this example doe not seem to need it
4. Is there a good tutorial on "Include Event Sheet" how and when to use them
5. Thanks to every for for helping me with this confusing issue.
Posts: 529
Reputation: 7,147

Post » Fri Jan 22, 2010 8:00 pm

1. Don't really need the always I put it there when I was trying to find what was up. It would be better if you moved the action in the always event to the last action in the "on RestHighScore clicked" event. Otherwise on the start of your layout you would show the best score loaded from your INI then, if you clicked reset it would reset the score in the INI file but not update the score that was shown onscreen.

2. Not really but what ever is in the event runs every tick. Best example is the one you used in your 2nd Layout.

+RaceTime - Set text to global('Seconds')

That way whenever the score is updated so is the text displaying it.

3. Use "Include Event Sheet" if you ever find yourself having to put the exact same code in each layout. For example you split your layouts into tracks for your racing game, so layout 2 is track 1, layout 3 is track 2, layout 4 is track 3 etc. You're going to need the controls for the car added to each event sheet for each layout/track. So put anything related to car controls in an event sheet, include it in all your track layouts and you don't have to add controls to each and every track/layout you make.

4. See above.

5. No problem :)

Hope that helps. My explaining is crap to say the least. Maybe someone will translate the above into English :).
Posts: 459
Reputation: 6,763


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 5 guests