Multiple Text Popups?

In this forum you will find and post information regarding the modding of Star Wars Battlefront 2. DO NOT POST MOD IDEAS/REQUESTS.

Moderator: Moderators

Post Reply
User avatar
Sky_216
Droid Pilot Assassin
Droid Pilot Assassin
Posts: 2086
Joined: Mon Feb 13, 2006 3:28 am
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set

Multiple Text Popups?

Post by Sky_216 »

Well, here's a little problem:
In the RPG I'm making, there are several times when I'd like a 'dialogue' or series of popup text screens (objective popup screens, such as in campaign) in sequence. Unfortunately, with just putting them one after (see example below) they just overwrite each other so only the last shows up. anyone know how to get around this?


Example (for intro bit):
Hidden/Spoiler:
onfirstspawn = OnCharacterSpawn(
function(character)
if character == 0 then

ReleaseCharacterSpawn(onfirstspawn)
onfirstspawn = nil
BeginObjectivesTimer()
ScriptCB_EnableCommandPostVO(0)
ShowObjectiveTextPopup("level.sr1.beach")
ShowObjectiveTextPopup("level.sr1.beach2")
ShowObjectiveTextPopup("level.sr1.beach3")
ShowObjectiveTextPopup("level.sr1.beach4")
ShowObjectiveTextPopup("level.sr1.beach5")
end
end)
User avatar
Maveritchell
Jedi Admin
Jedi Admin
Posts: 7366
Joined: Mon Aug 21, 2006 11:03 pm

Re: Multiple Text Popups?

Post by Maveritchell »

What I'd do (and this is no guarantee of efficiency) is use a series of timers to space the popups apart by a certain time. You can even "freeze" the unit's movement while the text is taking place, if you want (unit speed can be edited without forcing a respawn).
User avatar
Sky_216
Droid Pilot Assassin
Droid Pilot Assassin
Posts: 2086
Joined: Mon Feb 13, 2006 3:28 am
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set

Re: Multiple Text Popups?

Post by Sky_216 »

Maveritchell wrote:What I'd do (and this is no guarantee of efficiency) is use a series of timers to space the popups apart by a certain time. You can even "freeze" the unit's movement while the text is taking place, if you want (unit speed can be edited without forcing a respawn).
Heh, timers were first thing I thought of too. any idea what the minimum timer time is?
User avatar
Maveritchell
Jedi Admin
Jedi Admin
Posts: 7366
Joined: Mon Aug 21, 2006 11:03 pm

Re: Multiple Text Popups?

Post by Maveritchell »

The minimum isn't large enough to worry about. (I do not know the lower limit but it is well into small fractions of a second at least.)
User avatar
[RDH]Zerted
Gametoast Staff
Gametoast Staff
Posts: 2982
Joined: Sun Feb 26, 2006 7:36 am
Projects :: Bos Wars AI - a RTS game
Games I'm Playing :: SWBF2 and Bos Wars
xbox live or psn: No gamertag set
Location: USA
Contact:

Re: Multiple Text Popups?

Post by [RDH]Zerted »

The timers aren't designed to be used for small increments and aren't guaranteed to be exact. I would be hesitant to use a timer for less than 2 seconds and would never go below 1 second. The docs even mention this.
User avatar
Maveritchell
Jedi Admin
Jedi Admin
Posts: 7366
Joined: Mon Aug 21, 2006 11:03 pm

Re: Multiple Text Popups?

Post by Maveritchell »

[RDH]Zerted wrote:The timers aren't designed to be used for small increments and aren't guaranteed to be exact. I would be hesitant to use a timer for less than 2 seconds and would never go below 1 second. The docs even mention this.
I know that the docs say not to use them in small increments, however - I'm not positive, but - I'm pretty sure I've been told of microtimers working without much of a problem before. I know I've used them for the same thing I was recommending in the first place, though, so that's why I made the suggestion.
User avatar
Frisbeetarian
Jedi
Jedi
Posts: 1233
Joined: Wed Sep 12, 2007 3:13 pm

Re: Multiple Text Popups?

Post by Frisbeetarian »

It worked fine for me while playing around with SetEntityMatrix. From that topic:
Frisbeetarian wrote:The only problem I can foresee with this is that it requires constant Lua work as the timer runs every hundredth of a second to reset the matrix to make the motion fluid. If you know of a way to access the frame speed, I can just use that for the timer amount, since a hundredth of a second is much shorter than I actually need.
User avatar
Eggman
Master Bounty Hunter
Master Bounty Hunter
Posts: 1516
Joined: Mon Jul 16, 2007 1:30 pm
Projects :: Battlefront Chronicles
Location: Las Vegas

Re: Multiple Text Popups?

Post by Eggman »

Man, I wish I had thought of using timers for this in my last map. For the instances where I had multiple pages of dialogue, I just attached one popup to the completion of an objective, and the other on the start of the next objective. It worked well enough for me, but that method is only any good if you're using the type of objective sequence from the shipped campaigns. Plus, the length of time between the popups is a bit longer than I'd have liked it to be.
Post Reply