Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - CodeJunkie

#241
OK, another 2 pretty basic problems concerning the label:

1) How do I 'fill' the inside of a font with a colour (like LucasArts text)?  I can set the colour of the font itself, but I can't see any command for setting the inside colour.  If this isn't possible then how is the LucasArts style text done for the player?

2) For the hovering label I use this in the 'repeatedly_execute':

 SetGUIPosition(LABEL, mouse.x+5, mouse.y-10);

It works great, but the problem is that when the label drawing co-ordinated exceed the screen width or height the game crashes.  Because the label co-ordinates are drawn slightly away from the cursor this can happen when the cursor nears the edge of the screen.

I've tried using 'while' loops to only display the text when the mouse isn't near the edge of the screen:

function repeatedly_execute() {
 //put anything you want to happen every game cycle here
 while (mouse.x <= 235) {
   while (mouse.y >= 10) {
     SetGUIPosition(LABEL, mouse.x+5, mouse.y-10);
   }
 }
}


This however makes the game crash upon loading with this message:

(...)
(ACI version 2.60.698)

Error: run_text_script1: error -6 (Error (line 15): Script appears to be hung (150001 while loop iterations without an update)) running function 'repeatedly_execute'


Using positive numbers for the label position in accordance to the mouse position doesn't work, and neither does:

SetMousePosition(160, 120);


I can't think what else to do with these problems.  Sorry if some of the information is totally useless, I just want to make sure that people reading this know what I've already tried so that they don't post with an unhelpful solution.

Again, thanks in advance
#242
I've had a skim around the tutorials and the help manual but I couldn't find how to fix my problem, sorry if it was in there and I've missed it.
I want to make text labels that hover near the mouse cursor when it is over a hotspot, like in the Discworld games (and others I'm sure).
I've made the program run a script when 'Mouse moves over hotspot'.  Here's what I have:

DisplaySpeechAt(mouse.x+10, mouse.y-10, 300, JAMES, "Maintenance Door");

I've noticed that while this is near the mouse cursor, you have to click the mouse button to make it disappear, and then it will promptly reappear.  I would also assume that the character's talking animation will run when I use this (I haven't reached that stage yet).  I've seen that DisplaySpeechBackground won't interrupt the game and it won't start the talking animation, but there aren't any parameters for mouse.x and mouse.y
Thanks in advance.
SMF spam blocked by CleanTalk