SUGGESTION(?) - Position parameter on DisplaySpeechBackground

Started by Kinoko, Sun 12/09/2004 10:28:23

Previous topic - Next topic

Kinoko

I don't know whether this is a suggestion or a question. If it isn't currently possible through "backdoor" scripting, then it's a suggestion for DisplaySpeechBackgroundAt, I guess. (Perhaps removing the CHARID parameter).

Is there some relatively simple way to specify x and y coordinates with DisplaySpeechBackground?

Bernie

CreateTextOverlay lets you position the text, but you'll have to remove it by yourself. If you don't want to do that, you could use an invisible character and let it background talk. Just set the X/Y coords for it each time before it's gonna say something.

Kinoko

I really think that'd be a problem in this case, given the way I want to use it. Using an invisible character would be a real obstacle. Thanks anyway though. I'd considered overlays but these would be used to frequently (and several at a time in a lot of cases) it again seems too complicated. It might be my only option, I don't know...

Bernie

It seems that DisplayBackgroundSpeechAt is already on CJ's list, anyway.

I'm pretty sure that it's possible to code a custom function for what you need, though... maybe some kind soul will post a script like that for you later. :)

Pumaman

I was going to ask what the advantage would be over just using CreateTextOverlay, but I can see the point in the auto-removal, so I'll add it to my list.

You can hack your way around this by using CreateTextOverlay and then having some code in repeatedly_execute to remove the overlay after an appropriate time.

Bernie

That gives me an idea for a simple solution... when you display a text with CreateTextOverlay, also set a Global Value to, for example, 200 (would make the text appear for 4 seconds at 50 FPS). In Repeatedly Execute, check if the global value is bigger than 0, and if it is, keep subtracting 1. Compare if that global value is 1, if it is, remove the text overlay. That way, you can display the text for a custom amount of time and have the overlay automatically removed.

Kinoko

That's a solution for the mechanics of removal (Using a timer would work the same, I would imagine), thanks. How would I go about it automatically creating more than one instance of these overlays at a time? This would be used in real-time RPG style combat, so I need an overlay if one creature is hit, but several at a time if more than one is hit or if one creature is hit while another overlay is still up (without removing the first one).

Bernie

Ah... that's a bit tougher. I thought you only needed only one line at once. :3

Well, I'd create a custom function with integers for character number, x and y positions and display time, for convenience.
Then I'd use an array to keep track of overlay IDs in reference to the character number, and a second one as timer array, from which I'd subtract 1 from every slot each loop, and remove the overlay when it's down to 0. This involves a buncha while loops and so on.
If nobody else comes up with a better solution, I'll make that script for you tomorrow or so. The reason for this is that I'm sure there's a better, more efficient way to script this than my messy solution. ;)

This bit from the manual give me that idea:

int over1;
over1=CreateTextOverlay (50,80,120,2,15,"This is a text overlay");
Wait(200);
RemoveOverlay(over1);

Kinoko

Well, I hate putting people to work for me (or feeling like I am, anyway) so please don't feel like you have to. I'm in no great hurry as this game isn't due to come out for months yet, so I can afford to wait a decent time if a new function is going to be added.

Bernie

Haha, okay. :)
Should you still happen to need it before CJ gets around to implement it, let me know.

Kinoko


SMF spam blocked by CleanTalk