Adventure Game Studio

AGS Support => Advanced Technical Forum => Topic started by: SSH on Thu 27/03/2003 11:38:47

Title: Star Wars-style scrolling text
Post by: SSH on Thu 27/03/2003 11:38:47
I have made a star wars opening titles-type scroller. You will need:

1. A room with a starfield background and a continuously scaled walkable area (this example was 1 to 100% with the walkable area taking up 3/4 of the screen, vertically)
2. "Characters" for each line of text, with the views/sprites of the text to be scrolled as graphics with the perspective already applied (easy in PSP) (I have 4 lines here, characters 1 to 4)
3. This script:

$$$!$$$ ROOM room1.crm
$$$!$$$ RS
// room script file
int crawl=400;
int recip=84000;

function room_a() {
  // script for room: Repeatedly execute
crawl+=1;
character[1].y=recip/crawl;
if (crawl >= 494) {
  character[2].y = recip/(crawl-94);
  character[2].room = 1;
}
if (crawl >= 588) {
  character[3].y = recip/(crawl-188);
  character[3].room = 1;
}
if (crawl >= 682) {
  character[4].y = recip/(crawl-282);
  character[4].room = 1;
}
if (character[1].y < 82) {
  NewRoomEx(2, 160, 150);
}
}


This example was in a 320x200 room... you can change the settings of crawl and recip to change the speed and the initial X position. The sprites for each line of text were about 32 pixels high (and 320 wide)

EDIT:
You can see this now in my new game: Adventures of Princess Marian II: Mother's Day

http://www.adventuregamestudio.co.uk/yabb/index.php?board=5;action=display;threadid=5098;start=0#lastPost
Title: Re:Making a star-wars scroller
Post by: on Thu 27/03/2003 13:59:36
I could do a starwars scroller but really I'd be copying somethin being totally unoriginal. :P
Title: Re:Making a star-wars scroller
Post by: SSH on Thu 27/03/2003 14:36:45
Hey, I was just sharing the script in case anyone else wanted to do it: you don't have to be abusive!
Title: Re:Making a star-wars scroller
Post by: on Thu 27/03/2003 16:32:35
Whos being abusive? I'm sharing my point of view on copying work. You don't have to listen since I see it all the time. I'm not dissing your code. I'm sure its really cool.
Title: Re:Making a star-wars scroller
Post by: SSH on Thu 27/03/2003 16:44:58
I'm confused now: are you saying that its bad:

a) That I have created something that looks like the Star Wars opening text crawl
b) That someone might copy my code snippet to make their own text crawl when I'm happy for them to do so
c) That I have copied someone's code (I haven't, by the way)
d) Something else
Title: Re:Making a star-wars scroller
Post by: scotch on Thu 27/03/2003 17:11:14
It's A :)
Title: Re:Making a star-wars scroller
Post by: Joseph DiPerla on Thu 27/03/2003 21:35:28
I think there is a misunderstanding here somewhere...

Anyways.... Thanks for your contribution. Someone is creating a Star Wars game, maybe he can use this code for his game, who knows...


Joey
Title: Re:Making a star-wars scroller
Post by: deltamatrix on Thu 27/03/2003 22:25:05
All I was referring to was the idea of this scroller. I'm not dissing ur code and Im honored that your happy to share it with us. I know this code is purely yours.

Its just that its been done already by George Lucas which is my only concern. I'd still like to see it in your game though. The only times this style has been copied in other films/games was when it was intended as a joke or spoof. Like the beginnig of austin powers 2.

EDIT: 'This post was automatically edited to remove TXT-style spelling' Whats wrong with that?

BTW: Question for my fellow brits. Have you guys been having trouble getting on-line with the phoneline lately? I had loads of trouble as I'm using a re-router to connect.
Title: Re:Making a star-wars scroller
Post by: Darth Mandarb on Fri 28/03/2003 00:27:26
This is awesome!

I was working on something like this, but you just did the work for me!  I don't know if I'll use this in my game Rebel Spy (http://www.adventuregamestudio.co.uk/yabb/index.php?board=8;action=display;threadid=4914) because I like to use all my own stuff.  But if I can't get it to work on my own, can I use this?  If I do you'll get props in the credits!

dm
Title: Re:Making a star-wars scroller
Post by: SSH on Fri 28/03/2003 10:18:32
Feel free to us it in Rebel Spy if you like, Darth. The tricky bit is getting the text to slow down appropriately as it goes into the background. I'm not sure what should really be used for perspective calculations: maybe a square root would be better, but the reciprocal I use seems close enough. The numbers will certainly need some adjustment: for a 640x480 (your background size, I see) I would suggest using crawl start at 700, recip=350000, and if your lettering lines are 64 pixels high, bring in each new line after 102 repeats... but its trial and error until you get the speed you like (you can also change the game speed, which might be easier)

Delta, I am using the scroller as a joke... the game is for my wife for Mother's day and is very short so an overblown intro is ironic (she also loves Star Wars)

edit: here's the game announcement thread:
http://www.adventuregamestudio.co.uk/yabb/index.php?board=5;action=display;threadid=5098;start=0#lastPost
Title: Re:Making a star-wars scroller
Post by: on Fri 28/03/2003 15:21:55
Played it. Good job!

~~~~~~~~~~~~~~

Have the Iraqis sabotaged the phonelines? Im on 19.6kbps
Title: Re:Making a star-wars scroller
Post by: NavyNuke04 on Fri 28/03/2003 23:42:08
Yeah, good job! I took the liberty of checking out the pics you posted of your baby. Very cute! It's been a few years since mine were that small...
Title: Re:Making a star-wars scroller
Post by: Scummbuddy on Sat 29/03/2003 05:54:08
This didnt seem to hit me as to as how cool this really is until I saw the screenshot.  yeah, i knew what you were talking about, but this is really a good piece of code.  

Thanks a lot. Of course I'll cite you if I decide to use it.
Title: Re:Making a star-wars scroller
Post by: FenderQ on Sat 29/03/2003 07:00:32
Thanks very much for sharing your work with the community.  I think sharing your work like you've done is one of the things that make this community so great.

Well done!  :D
Title: Re:Making a star-wars scroller
Post by: Scummbuddy on Sat 24/05/2003 15:21:13
It took me like an hour to re-find this thread.  I have decided to use this textscroll, and I will credit you with it when I release my game.  Thanks.
Title: Re:Making a star-wars scroller
Post by: on Sat 24/05/2003 18:18:42
Quote from: Scummy-HOP on Sat 24/05/2003 15:21:13
It took me like an hour to re-find this thread.  I have decided to use this textscroll, and I will credit you with it when I release my game.  Thanks.

thank you for looking i've been after something like this :D! and well done SuperScottishHero, and i'll do likewise with a credit in the game

woodz
Title: Re:Making a star-wars scroller
Post by: SSH on Mon 26/05/2003 12:01:02
Glad you find it useful, guys!

Just remember to nominate me for every category in the next AGS Awards  ;)
Title: Re: Making a star-wars scroller
Post by: DeviantGent on Sun 20/06/2004 15:51:00
Ah ha!

This will come in veeeeery handy for the Star Wars game I'm making. All right if I use it? You'll get a mention in the credz.
Title: Re: Making a star-wars scroller
Post by: SSH on Mon 21/06/2004 10:21:10
Of course, that's why I posted it here. Please PM me when your game is released so I can give it a go!
Title: Re: Making a star-wars scroller
Post by: DeviantGent on Tue 22/06/2004 12:28:44
Probably won't be for a while. It's something I've literally just started in AGS - I've been beavering away at it for about 6 months in Klick N Play and getting nowhere fast. Still, it'll be really good as a result.

Cheers. I'll make sure you get a copy.
Title: Re: Making a star-wars scroller
Post by: Monk on Tue 14/09/2004 13:56:14
nothing such as abusing in this script! youre good kid.. being nice and sharing something with others are tooooootallyyyy goood!

keep up the good work!  ;)
Title: Re: Star Wars-style scrolling text
Post by: SSH on Thu 24/11/2005 13:03:26
Now, also see the MODULE of this in: http://www.adventuregamestudio.co.uk/yabb/index.php?topic=23563.0