creditz?

Started by spook1, Fri 05/03/2004 20:39:37

Previous topic - Next topic

spook1

I could not find this item, sorry if I overlooked anything.

I make an intro to my game SpaceSpy, using the creditz plugin.
The intro is quite a story, and when the first line reaches the top of the screen the creditz are turned of, instead of riollingon and showing the bottom lines of the intro-stry.
Any suggestions are very welcome,
kind regards, Martin Koops

Scorpiorus

Can you post the related script code you have?

spook1

okidoki:

Wait(50);

SetEmptyLineHeight(40);
ScrollCredits (1,0, 400, -400, 1, 10, 2);

SetCredit (1,"Het was in het jaar 2145 dat de eerste kolonie ", 12,0,0,10,0);
SetCredit (2,"", 12,0,0,10,0);  
SetCredit (3,"buiten ons zonnestelsel werd gesticht in Quopurs.", 12,0,0,10,0);

SetCredit (5,"Niet lang hierna kwamen de oorspronkelijke bewoners ", 12,0,0,10,0);
SetCredit (6,"", 12,0,0,10,0);
SetCredit (7,"van het zonnestelsel Quopurs in opstand", 12,0,0,10,0);

SetCredit (9,"Na een oorlog die honderd jaar duurt komen de ", 15,0,0,10,0);
SetCredit (10,"", 12,0,0,10,0);
SetCredit (11,"aardbewoners als winnaar uit de strijd", 12,0,0,10,0);

SetCredit (12, "In deze honderd jaar zijn zij echter  vervreemd  ", 15,0,0,10,0);
SetCredit (13,"", 12,0,0,10,0);
SetCredit (14,"van de aardbewoners,", 12,0,0,10,0);

SetCredit (16, "de kinderen die in Quopurs zijn opgegroeid", 15,0,0,50,0);
SetCredit (17,"", 12,0,0,10,0);
SetCredit (18,"kennen de aardbewoners alleen uit verhalen.", 12,0,0,10,0);

SetCredit (20, "en de aardbewoners en Quopurs zijn als ", 15,0,0,50,0);
SetCredit (21,"", 12,0,0,10,0);
SetCredit (22,"vreemden, aliens, voor elkaar geworden....", 12,0,0,10,0);

SetCredit (24, "Wanneer er van Aarde een schip landt in Quopur,  ", 15,0,0,50,0);
SetCredit (25,"", 12,0,0,10,0);
SetCredit (26,"met de wens om grondstoffen naar Aarde te verschepen ", 12,0,0,10,0);
SetCredit (27,"", 12,0,0,10,0);
SetCredit (28," ontstaat er een nieuwe strijd.",12,0,0,10,0);

SetCredit (30, "De technisch superieure aardbewonders leggen het af ", 15,0,0,50,0);

SetCredit (32,"tegen de Quopurs die hun zonnestelsel kennen als hun broekzak", 12,0,0,10,0);

SetCredit (34, "De Quopurs ontbranden in een furie wanneer Aarde meer troepen ", 15,0,0,50,0);
SetCredit (35,"", 12,0,0,10,0);
SetCredit (36,"stuurt en verleggen het strijdtoneel naar het zonnestelsel van de Aarde", 12,0,0,10,0);

SetCredit (38, "Voor Aarde is dit een benarde situatie. gelukkig heeft ze een troef in handen:", 15,0,0,50,0);

SetCredit (40, "De infiltrante Volta, bevindt zich namens Aarde aan boord van een van de schepen van de Quopurs", 15,0,0,50,0);
SetCredit (41,"", 12,0,0,10,0);
SetCreditImage(43, 6, 1, 1, 1); //picture Volta in creditz
SetCredit (45, "Haar opdracht zal haar spoedig bekend gemaakt worden. Voorlopig luidt haar missie:",15,0,0,50,0);


Scorpiorus

#3
Aha, move the ScrollCredits command to the end of the script:

....
....
....
SetCredit (40, "De infiltrante Volta, bevindt zich namens Aarde aan boord van een van de schepen van de Quopurs", 15,0,0,50,0);
SetCredit (41,"", 12,0,0,10,0);
SetCreditImage(43, 6, 1, 1, 1); //picture Volta in creditz
SetCredit (45, "Haar opdracht zal haar spoedig bekend gemaakt worden. Voorlopig luidt haar missie:",15,0,0,50,0);
 
ScrollCredits (1,0, 400, -400, 1, 10, 2);  

spook1

Thanks a lot. it worked.

I have a textscrolling by now. I have to add extra lines between two following lines to prevent text from being printed over a former line.
can i adjust the spacing bwteen two following lines?
I have added extra lines everywhere now, and by adjusting EmpyLineHeight I can adjsut linespacing.

Is there a way to add extra lines  at a later stage?
Or do I have to change all nubering when I decide to add an extra paragaph?

kind regards,
Martijn

Scorpiorus

QuoteIs there a way to add extra lines at a later stage?
Or do I have to change all nubering when I decide to add an extra paragaph?
I don't know if there is another way but you can write a custom function to increase ID automatically:

int currentID = 0;

function SetCreditEx(string Text, int Color, int Font, int Centered, int Xpos, int Generateoutline) {

   currentID++;
   SetCredit(currentID, Text, Color, Font, Centered, Xpos, Generateoutline);

}

Then you have:

currentID = 0; //reset just for sure
SetCreditEx("Het was in het jaar 2145 dat de eerste kolonie ", 12,0,0,10,0);
SetCreditEx("", 12,0,0,10,0);
SetCreditEx("buiten ons zonnestelsel werd gesticht in Quopurs.", 12,0,0,10,0);
...
...
etc

~Cheers

OverWind

#6
IMHO, a better method of doing it is:

Code: ags

int currentID = 0;
int color = 12;
int font = 0;
int centered = 0;
int xpos = 10;
int generateoutline = 0;

SetCredit(++currentID,"Test",color,font,centered,xpos,generateoutline);
SetCredit(++currentID,"Test2",color,font,centered,xpos,generateoutline);
SetCredit(++currentID,"Test3",color,font,centered,xpos,generateoutline);


I don't know how much overhead it takes to call a function (probably next to nothing) but even though I recommend moving most of your code into functions, this is not one of those things :)

Of course, even though you use my version or your version, moving the parameters to variables is always wise, since, if you want to move xpos 2 pixels only have to edit one line, instead of each and every line.

If you really want to use a function for this, I'd recommend something along the lines of:

Code: ags

int currentID = 0;
int color = 12;
int font = 0;
int centered = 0;
int xpos = 10;
int spec_xpos = 50;
int generateoutline = 0;

function addCreditLine(string Text) {
     SetCredit(++currentID,"Test3",color,font,centered,xpos,generateoutline);
}
function addSpecialCreditLine(string Text) {
     SetCredit(++currentID,"Test3",color,font,centered,spec_xpos,generateoutline);
}
function addCreditSpace() {
     currentID++;
}
addCreditLine("I am a credit line");
addCreditSpace();
addCreditLine("I am another credit line");
addCreditLine("I am another credit line");
addSpecialCreditLine("I am so special"); // I noticed the OP (original poster) needed something like 
this.
addCreditLine("I am another credit line");
addCreditLine("I am another credit line");


Which is easier to write.

By the way, does anyone know if there's a BBCode equivilant for <code></code> ?
Sleep is for losers, baggy eyes are for winners!

Scummbuddy

when you post, there is a link called "BBCode and Smililes Reference" just above the message reply box.

http://www.agsforums.com/yabb/YaBBHelp/posting.html

make a open bracket, then 'code' and then closing bracket, then your code, then open bracket, "/code" and then closing bracket.

Code: ags
 here 
- Oh great, I'm stuck in colonial times, tentacles are taking over the world, and now the toilets backing up.
- No, I mean it's really STUCK. Like adventure-game stuck.
-Hoagie from DOTT

OverWind

Hi ScummBudy,

Well, I actually looked at that page, and the code tag is nowhere to be found, but thanks for letting me know. :)
Sleep is for losers, baggy eyes are for winners!

Scummbuddy

heh, yeah, i realized that as i was typing it, and had to remember what it was, so i just finished up the post, but you are right, its not on there, and it should be, but i think thats a general info page, not detailed to us.
Jeez, now im all inspired to get these little facts back for everyone to read.
- Oh great, I'm stuck in colonial times, tentacles are taking over the world, and now the toilets backing up.
- No, I mean it's really STUCK. Like adventure-game stuck.
-Hoagie from DOTT

spook1


Trying your code I get an error:

parse error in expr near ++

and also the message that color is already defined ...

ichanged the variable into "colour" which solved the second error. Why is ++currentID not working properly?
P.S. I must warn you that I am definitely in a learnign phase, so my questions may seem silly from time tot time ;-(

kind regards, Martijn

Alynn

Try currentID++

spook1

Tried it:

SetCredit(currentID++,"Test",colour,font,centered,xpos,generateoutline);


error : parse error expression near "currentID"

regards,

Martijn

spook1

I figured it out.

The following code was just tested and works fine:

int currentID = 0;
int colour = 12;
int font = 0;
int centered = 0;
int xpos = 10;
int spec_xpos = 50;
int generateoutline = 0;

function addCreditLine(string Text) {
SetCredit(currentID,Text,colour,font,centered,xpos,generateoutline);
}
function addSpecialCreditLine(int image) {

currentID = currentID+1;

// from plugin manual: "SetCreditImage (int ID, int Slot, int center, int xpos, int "pixtonext);
SetCreditImage(currentID,image,1,1,1);
}
function addCreditSpace() {
currentID++;
}

function room_a() {
 // script for room: First time player enters screen

SetEmptyLineHeight(10);

addCreditLine("text 1");
addCreditSpace();
addCreditLine("text 2");



Do you think it has to do with my compiler??

martijn

Scorpiorus

Quote from: spook1 on Fri 19/03/2004 20:05:48Do you think it has to do with my compiler??
Nope, it's just because AGS doesn't allow that ++/-- stuff as function arguments, i.e. it won't accept SetCredit(currentID++, ...);

~Cheers

SMF spam blocked by CleanTalk