Author Topic: MODULE: Credits v1.19  (Read 23094 times)

SSH

  • Flying round the world at the speed of haggis
    • I can help with scripting
    •  
    • SSH worked on a game that was nominated for an AGS Award!
      SSH worked on a game that won an AGS Award!
MODULE: Credits v1.19
« on: 22 Sep 2005, 16:22 »
The normal download now includes the source for a demo game. Demo game requires 2.72beta7 but the module should work with AGS v2.71 or later. Version 1.19 now makes translations work properly (which 1.18 failed at).

Credits module.

I never used the Creditz plugin, but I read the help file and tried to match its functionality.

Where n is credit seuqence number, staring with 0
//   Credit[n].AddTitle(const string t, optional int x, optional int font, optional int colour)
//   Credit[n].AddCredit(const string t, optional int x, optional int font, optional int colour);
//   Credit[n].AddImage(int sprite, optional int x, optional int valign)
//   Credit[n].Run();
//   Credit[n].Pause();
//   Credit[n].Stop();
//   Credit[n].IsRunning();

Example:

Code: Adventure Game Studio
  1. Credits[0].DefaultCreditFont=3;
  2. Credits[0].DefaultTitleFont=3;
  3. Credits[0].DefaultTitleColour=65000;
  4. Credits[0].DefaultCreditColour=15;
  5. Credits[0].Delay=1;
  6.  
  7. Credits[0].AddTitle("Scripting by");
  8. Credits[0].AddCredit("SSH");
  9. Credits[0].AddImage(12, eCreditCentred, eCreditAlignBelow);
  10. Credits[0].AddTitle("ScrollingCredit Module by");
  11. Credits[0].AddCredit("SSH again!");
  12. Credits[0].Run();
  13.  

Have fun!

Download Credits module here (Requires AGS v2.71!)
View Full instructions
« Last Edit: 13 Aug 2009, 12:09 by SSH »

Pumaman

  • Creator of AGS
  • Administrator
  • Mittens Monarch
  • I sense danger.
    • Lifetime Achievement Award Winner
    •  
Re: MODULE: ScrollingCredits v1.0
« Reply #1 on: 24 Sep 2005, 12:34 »
Good stuff -- I haven't had time to try it out yet, but having a module alternative to the Creditz plugin will be very handy  :)

vampyredcs

  • Guest
ScrollCredits question using ScrollingCredits module 1.0
« Reply #2 on: 24 Oct 2005, 10:54 »
I have switched from the plugin to the module because I was getting an error about "const string" and was unable to find a work around. (Using AGS v2.71 RC2 and Credtis plugin v2.0.0.6).

Credits run but I am unsure how to change rooms after said sequence finishes.  AJA's plugin had a 'IsCreditsFinished' function.  Is there such a feature in the new module by SSH?

Thanks

SSH

  • Flying round the world at the speed of haggis
    • I can help with scripting
    •  
    • SSH worked on a game that was nominated for an AGS Award!
      SSH worked on a game that won an AGS Award!
Re: ScrollCredits question using ScrollingCredits module 1.0
« Reply #3 on: 24 Oct 2005, 11:12 »
Hey, I'm glad someone's using this. I guess if the plugin doesn't work with AGS 2.71 then it will be used a lot more... but maybe CJ should put something in that makes older plugin APIs work with the new strings, otherwise everything will need to be recompiled.

The answer is:

Code: Adventure Game Studio
  1. if (Credits[n].IsRunning == eCreditFinished) {
  2.  
  3. }
  4.  

as described in the script module README and in the module header:

//   Credit[n].IsRunning();
//      This function returns a value of type CreditRunning_t, which will be equal to
//      eCreditFinished when the sequence has finished.

although, now I notice that this says Credit rather than Credits: another thing to fix in the next version!

Edit:

So, I've fixed most of the problems with the Static credits and now both versions should work. See top post for details

I've also included a function that inserts linebreaks into typewriter credits to make the wordwrap look better

Edit 2:

Please feel free to suggest improvements or note bugs, although I don't promise to fix any!
« Last Edit: 19 Mar 2007, 21:40 by strazer »

Re: MODULE: Credits v1.12
« Reply #4 on: 13 Nov 2005, 04:07 »
Yo, SSH!

This is awesome!, I like this better than Aja's

much eaiser to use, too!

i can't get his to work for NOTHING!

 ;D ;D ;D ;D ;D ;D ;D :-*
Narcolepsy (BACK IN PRODUCTION)
Story (50%)
Graphics (5%)
Puzzles(20%)
Programming(15%)

Still Reading Commercial Emails For Free?
Receive Emails On Topics That Interests You
And Get Paid For It! Get $10 Just to signup!
http://hits4pay.com/members/index.cgi?bleckman1974

Candle

  • Truly Hated
Re: MODULE: Credits v1.12
« Reply #5 on: 13 Nov 2005, 11:07 »
How to add player.ChangeRoom(player.PreviousRoom); so at the end it will return to last room? I get an overlay error now when I add that to the end of the credits lines.
« Last Edit: 07 Apr 2006, 20:19 by strazer »

Ashen

Re: MODULE: Credits v1.12
« Reply #6 on: 11 Dec 2005, 22:25 »
In the repeatedly_execute function for the room, just put:
Code: Adventure Game Studio
  1. if (Credits[0].IsRunning() == eCreditFinished){
  2.   player.ChangeRoom(player.PreviousRoom);
  3. }
  4.  

At least, that works in the version I have.
« Last Edit: 07 Apr 2006, 20:20 by strazer »
I know what you're thinking ... Don't think that.

Peder 🚀

  • Been nearly 10 years, think it's time for a change
    • Lifetime Achievement Award Winner
    •  
Re: MODULE: Credits v1.13
« Reply #7 on: 23 Mar 2006, 22:09 »
so, I had this error:

"Error (line 116): type 'string' is no longer supported; use String instead"

If I changes it to "String" I get an error on the next line instead...

SSH

  • Flying round the world at the speed of haggis
    • I can help with scripting
    •  
    • SSH worked on a game that was nominated for an AGS Award!
      SSH worked on a game that won an AGS Award!
Re: MODULE: Credits v1.13
« Reply #8 on: 24 Mar 2006, 09:48 »
Hmmm, I thought I'd documented that the "Enforce new style Strings" checkbox in the General settings of the editor needed to be unchecked... sorry!
« Last Edit: 19 Apr 2006, 23:12 by strazer »

The_Creep

  • Later...in the emergency room
Re: MODULE: Credits v1.13 (new dl site)
« Reply #9 on: 17 Apr 2006, 21:09 »
Great Module SSH thanks! I just have one question, and I feel kind of silly asking, I have my messages displayed in a custom textbox (GUI 3) and the credits also display in this textbox (and the textbox size stretches all the way to the right hand edge of the screen), do you know how I can make the credits just display as plain text?
If you had nothing left, would you risk it all to change everything?

SSH

  • Flying round the world at the speed of haggis
    • I can help with scripting
    •  
    • SSH worked on a game that was nominated for an AGS Award!
      SSH worked on a game that won an AGS Award!
Re: MODULE: Credits v1.13 (new dl site)
« Reply #10 on: 18 Apr 2006, 13:58 »
Not sure I understand the question: the Credits are displayed using Text Overlays and shouldn't be affected by any custom textboxes (I assume you mean one used for the Display() function).

Can you give a screenshot or source code of the issue?

The_Creep

  • Later...in the emergency room
Re: MODULE: Credits v1.13 (new dl site)
« Reply #11 on: 18 Apr 2006, 15:39 »
Yup, the one used for Display(); I have since come across the source of the problem, my game 's speech style is set to "Sierra Style with Background" if I turn  this to just plain sierra style, or lucasarts, it works perfectly,  but I would really like to keep my style as it is and have my credits, so if you can think of a workaround let me know :)

I will post screenshots shortly, and as for the sourcecode, I copy pasted the example from the readme, so there should not be any errors there.

Edit:

Fixed it!

The problem WAS the speech style,  (Sierra with Background), for some reasons dumps the custom textbox behind the credits (and distorts it).

So I just put

SetSpeechStyle(Lucasarts);
*Your credits code here*

then when the Credits returned the value that they were finished I just set the style back with:

SetSpeechStyle(eSpeechSierraWithBackground);

Thanks again for an excellent module!

Edit 2:

ey, sorry I know I'm being a pest, and I know I will kick myself when I see the solution

I want to make it so that the player can click the mouse or press esc to end the credit sequence, but I'm damned if I can figure out how, what I have done is filled the room with hotspot1, and said that anyclick will move player to room1, but the game crashes out and gives me the error message: Invalid Overlay ID specified. so obviosly before I change rooms, I need to tell the credits that they are finished, and to cease and desist, how I would I do this? I'm sure its a similar piece of code to the one you put in the repeatedly_execute room, but I just cant figure it out.
« Last Edit: 18 Apr 2006, 19:04 by strazer »
If you had nothing left, would you risk it all to change everything?

SSH

  • Flying round the world at the speed of haggis
    • I can help with scripting
    •  
    • SSH worked on a game that was nominated for an AGS Award!
      SSH worked on a game that won an AGS Award!
Re: MODULE: Credits v1.13
« Reply #12 on: 18 Apr 2006, 17:32 »
1) Don't triple-post: edit your previous entries
2) No, actually, there isn't currently a way to do this! I need to add some code to the module for this and I will try and do this ASAP: watch this space!
3) Please make a thread in Tech Forum reporting the bug you found with that speech mode!

EDIT:
Well, actually, you could use the SkipCutscene thing to zip through it and then chnage, I guess...

However, I've now updated the module to have a Stop function for just this case. Thanks for pointing out this deficiency!
« Last Edit: 18 Apr 2006, 21:23 by SSH »

Alynn

  • I'm ugly because I'm pixelated, what's your excuse
    • I can help with scripting
    •  
Credits 1.14 (nevermind SSH issue)
« Reply #13 on: 16 Jul 2006, 13:26 »
Sorry, after playing around for a bit it's something with SSH's code, it seems that using the [ character at the end of a Title or Credit that has a StarTransition of simple never disappears, but any other kind of start transition it will display that line and the next line.

There also seems to be an issue with scrolling from top.

Sorry I've just been working on this thing for hours now and I was getting frustrated...

Edit:
Ok code snippet
Code: Adventure Game Studio
  1. //Credits[0].DefaultTitleStartTransition = eSlideTop;
  2.  
  3. Credits[0].addTitle("A Game By[");
  4. Credits[0].addCredit("Yellow Eyed Studio");
  5.  

Note: Doing this from memory, so the eSlide may be wrong. but that's the general idea of the code. The only Credits code above the first line I posted was the default font settings and default color settings.

Leaving the comment in the credits will start displaying "A Game By" in the correct font, howver that font will never leave and the rest of the credits will never run.

If you remove the comment it will work, but not as expected. There is a brief flash of the Title line in the center of the screen, then it will appear in the correct location, the credit text appears as well. Both are then removed correctly.

Any other DefaultStartTransition and it will work as expected. With the text scrolling in from the sides or the bottom. The issues seem to stem about removing the text with there is a [ present at the end of the string, and with top down sliding.

What I am shooting for is this
    A Game By
Yellow Eyed Studio

That appears at the same time, both go away and the next title and credit are displayed. From what I thought putting [ at the end of the title line, and setting both start and end transitions to simple (which is the default so I never actually set them).

Yet another edit...
Suggestion: Is there any way to center the text when using a breakline? IE "Adventure Game Studio[by Chris Jones". Currently it shows text as
Code: Adventure Game Studio
  1. Adventure Game Studio
  2. by Chris Jones

What I would like to see is
Code: Adventure Game Studio
  1. Adventure Game Studio
  2.    by Chris Jones
« Last Edit: 17 Jul 2006, 12:58 by Alynn »

SSH

  • Flying round the world at the speed of haggis
    • I can help with scripting
    •  
    • SSH worked on a game that was nominated for an AGS Award!
      SSH worked on a game that won an AGS Award!
Re: MODULE: Credits v1.16
« Reply #14 on: 26 Jul 2006, 08:08 »
Top slide is definately fixed now. And the simple credits with a [ works in the demo included in the zip file...

Alynn

  • I'm ugly because I'm pixelated, what's your excuse
    • I can help with scripting
    •  
Re: MODULE: Credits v1.16
« Reply #15 on: 26 Jul 2006, 19:37 »
Ok now it werkies for me... After commenting out all of your debug label code you left in :P

Now that that is setup, could you perhaps add functionality that only removes a Credit if another Credits is up, and only gets rid of titles if a new title is to be loaded...

What I'm looking for is the title text to be static, while the credits for that particular title scroll from the left pause briefly under the title and then scroll right, the title only scrolling off after the last  credit for that title has passed.

For an example haveing both the credits and the titles slide from the left, and slide out to the right.

Credits[0].setTitle("In association with:");
Credits[0].setCredit("Skytower Games");
Credits[0].setCredit("twIg");

In association with: and Skytowergames would slide in together, Skytower Games would slide out twIg will slide in, and then both Title and Credit will slide out at the same time...

I know I know it's probably easier said than done, but I've looked over your code, and the complete lack of any kind of comments makes it cryptic to decipher :P. Since Obviously I couldn't see what the origional problem was with static creds and all that...

Anyway if you can't add that it's not a huge deal, but thanks for your work getting the rest up and running.

SSH

  • Flying round the world at the speed of haggis
    • I can help with scripting
    •  
    • SSH worked on a game that was nominated for an AGS Award!
      SSH worked on a game that won an AGS Award!
Re: MODULE: Credits v1.16
« Reply #16 on: 27 Jul 2006, 12:27 »
Well, I've got something that might work for you... now you can keep credits on screen by putting any of a set of user-defined characters at the end of the line, and putting the same character at the beginning of the line will clear any old lines with that character on.

So, if you download the zip and look at the included "game" you'll see how it works, I hope. And the debug code should get automatically left out, too ;)

Credits module error
« Reply #17 on: 11 Oct 2006, 03:19 »
When I try to run the credits module i get an error saying "x is a global var; cannot use as a name for local."

Edit:

Thanks KhrisMUC, I've found a global variable called x and renamed it. It's fixed!
« Last Edit: 19 Mar 2007, 21:44 by strazer »



Khris

  • having to deal with what games are going through
    • Lifetime Achievement Award Winner
    •  
    • I can help with play testing
    •  
    • I can help with scripting
    •  
    • I can help with translating
    •  
    • Khris worked on a game that was nominated for an AGS Award!
Re: Credits module error
« Reply #18 on: 11 Oct 2006, 03:21 »
Are you using a variable called "x" in any of your functions or even as a global variable?
If you need it, rename it, if not, find the line where it says "int x;" and remove it.

Are you using another plugin or a module perhaps? Anything else that might use a variable called x?

If not, check if the module supports your version of AGS.
« Last Edit: 19 Mar 2007, 21:44 by strazer »

SSH

  • Flying round the world at the speed of haggis
    • I can help with scripting
    •  
    • SSH worked on a game that was nominated for an AGS Award!
      SSH worked on a game that won an AGS Award!
Re: MODULE: Credits v1.18
« Reply #19 on: 16 Feb 2007, 13:22 »
v1.18 is up to fix a translation-related problem that Cinfa found.