Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

FPSC Classic Scripts / Problem getting a hud image to display after text

Author
Message
bruce3371
14
Years of Service
User Offline
Joined: 4th Aug 2010
Location: Englishland
Posted: 22nd Feb 2012 15:54 Edited at: 22nd Feb 2012 17:06
I've been wracking my brain over this for a while now. I figured, rather than coming straight to the forums and asking for help first, I'd have a go at writing this script myself, try and learn something (even though I'm cheating by adapting someone else's script!)!

Trouble is I can't get it to work exactly how I want it to!

What I'm trying to achieve is this; Text is displayed on screen, followed, after a short delay, by a hud image. So, on screen, you have the text introducing Part 1 of the game, followed by a hud image showing the game's mission briefing.

Instead what I'm getting on screen is the text, then the hud image is displayed on top of it, before the text disappears. I want the text to disappear before the hud image is displayed.

Here's the script I've written (by the way, it is partly based on Storyteller's adventure game scripts, so credit where credit's due);



Can anyone give me any pointers about what I'm doing wrong? I don't necessarily want the script re-written for me, just some hints to point me in the right direction. I am, after all, trying to learn scripting for myself!

BlackFox
FPSC Master
16
Years of Service
User Offline
Joined: 5th May 2008
Location: Knight to Queens Bishop 3
Posted: 22nd Feb 2012 22:50
I bet you just knew I was going to reply.

First, use the "etimerstart/etimergreater=x" commands. It will save you so much headaches. Just disown the "timerstart/timergreater" commands- pretend they do not exist.

Second, here is a modification of your beginning lines:



The reason I lay mine out like this is so that if I want to add more huds, I know all I have to do is add to the ":state=0" lines. I always use the ":state=0" lines for defining my huds, and the rest of the script starts at ":state=1". It is the same for when I build applications in Visual- I have a specific structure for laying out my work and it makes it easier if you stick with that type of pattern. I guess I am just picky with layouts and I apologize, but it will help if you stay consistent with a particular pattern and your states are not "jumping around" from line to line for troubleshooting later.

Now for your question. You can use the "fpgrawtextoff" command first and then show the hud on the next state. That should remove the text just before the hud comes up.


Twitter: @NFoxMedia
bruce3371
14
Years of Service
User Offline
Joined: 4th Aug 2010
Location: Englishland
Posted: 22nd Feb 2012 23:03 Edited at: 22nd Feb 2012 23:04
Thanks as always Blackfox. Of course, you were the LAST person I expected to reply lol

Quote: "use the "etimerstart/etimergreater=x" commands"


The stupid thing is, I know about those not being too great, but I still went and used them. I think it may have been as simple as a typo on my part, as I had Etimer etc in my head at the time (that's my excuse, and I'm sticking to it)!

As for layout, I try to use multiple state=0 and state=10 lines at the beginning of my scripts, for the very reason you say; it keeps things tidy.

As for the fpgrawtextoff command, thanks, I'll try that

bruce3371
14
Years of Service
User Offline
Joined: 4th Aug 2010
Location: Englishland
Posted: 23rd Feb 2012 02:32 Edited at: 23rd Feb 2012 02:33
Ok, I'm going to double post, as Blackfox's solution worked and other people might be interested in using this script (hope that's ok with the Mods).

The script now looks like this;



As you can see, I took on board all of Blackfox's suggestions, including the laypout of the hud section at the top. The 'fpgcrawtextoff' command achieved exactly what I wanted it to; i.e. The text shows up, then disappears just before the hud image displays.

Thanks very much for your help as always Blackfox!

So, for anyone who needs on-screen text to show up, followed by a HUD image, please feel free to use this script...

Meows
13
Years of Service
User Offline
Joined: 12th Oct 2011
Location: Totally over the Rainbow
Posted: 11th Mar 2012 03:35 Edited at: 11th Mar 2012 03:37
Thank you! *hugs*
It will help me!

err / etimer?

Life is a short trip to another world

Login to post a reply

Server time is: 2024-11-24 02:37:55
Your offset time is: 2024-11-24 02:37:55