Page 1 of 2

Neat AGS codes collection.

Posted: Sat Aug 21, 2004 12:47 am
by Fribbi
I made this thread so you can share some useful AGS codes here. So if you got one please put it here. Thanks. :D

Posted: Sat Aug 21, 2004 5:56 am
by LucasFan
SetRemakeStyle (int style)

Changes the default graphic style of the game. style can be one of the following:

LUCASARTS_16
LUCASARTS_256
SIERRA_2 (Mystery House)
SIERRA_16
SIERRA_256
SIERRA_HIRES_TRASH (KQ7, SQ6)

Example:

SetRemakeStyle (SIERRA_HIRES_TRASH);
will turn your game into a boring SVGA Disney-clone. ;)

Posted: Sat Aug 21, 2004 7:36 am
by Klytos
:rollin

Posted: Sat Aug 21, 2004 9:33 am
by Erpy
That statement isn't accurate unless you place the following code into your "game_start" section:

Code: Select all

function checkultimatetruth() {

if ((system.screen_width>=640)&&(system.screen_height>=400)) {

//check resolution and apply universal truth
crappyplotbydefault=1;
crappypuzzlesbydefault=1;

}
//if resolution ruined plot and puzzles, quit game
if ((crappyplotbydefault==1)&&(crappypuzzlesbydefault==1)) quitgame(0);

}
Image

Posted: Sat Aug 21, 2004 2:57 pm
by Jafar
I never noticed that code button before...

Code: Select all

Ecret-Say Ode-Cay!
:p

Posted: Sat Aug 21, 2004 4:03 pm
by Erpy
Rather than going further OT, what kind of code were you looking for Fribbi?

Image

Posted: Sat Aug 21, 2004 5:11 pm
by Fribbi
Just a codes like you gave me in the "How to make Lsl3 by Fribbi and Erpy"thread. It is not for me it is for everyone here who needs a good and useful and valuable AGS codes. It could be very handy in the future you know.

Just any codes you can share will be fine.

Posted: Mon Aug 23, 2004 6:35 pm
by Fribbi
Ok I need codes like how to let character walk while the message is displaying on the screen because the character can't move when the message is on the screen.

Just some codes that everybody can use will do fine here. That's all.

Posted: Mon Aug 23, 2004 6:40 pm
by Erpy
I don't think there's any way to keep a character on the move while a message displayed with the display-function or displaymessage-function is on-screen. There are ways of displaying blocks of text on the screen and still keep some things running in the background.

If you use a MoveCharacter-function (not MoveCharacterBlocking) and use a function like DisplaySpeech or DisplayTopbar, the character should keep moving. You can also create a text-overlay with the CreateTextOverlay to keep 100% control of the environment.

Image

Posted: Mon Aug 23, 2004 8:28 pm
by 1eyedParrot
Use the function repeatedly_execute_always(), although remember not to use blocking functions with it.

Posted: Mon Aug 23, 2004 9:00 pm
by Angelus3K
It is not for me it is for everyone here who needs a good and useful and valuable AGS codes.
2 Days Later

Ok I need codes like how to let character walk while the message is displaying on the screen
Thats hilarious lol

Fribbi if you needed something specific just ask, Im sure someone could help you ;)

Posted: Wed Sep 01, 2004 9:03 pm
by Fribbi
Do you know where I can get some useful AGS codes so I can use it in my own future project. I just want to learn on this stuff that's all I am asking for. The reason I quited on the remakes on the Leisure suit Larry 3 was because there is so many stuff I can't handle with. So right now I am just practicing. I am right now creating a new game with all my knowledge I know of AGS code stuff. And I have see a lot of games who is made of beginners who has the same problem as I have. So by giving out a useful and codes for a car racing game or "Fighting game" shooting game or something else it would be so cool.

Angelus are people still downloading my latest demo of Leisure suit Larry 3 VGA? You may delete it from the website if you want because that demo had so many errors and bugs inside. I was only showing the people how far has been done. And as many people could see it was not much done there. But I have made more backgrounds image for that game.

So yes I am still working on that game but I'm note sure any longer if I can release it out. It could be very risky as you all know.

Posted: Wed Sep 01, 2004 9:16 pm
by 1eyedParrot
Many of the functions and variables and explained in the help file. If you want help you need to be more specific about it.

Posted: Thu Sep 02, 2004 6:54 am
by Zeus
Fribbi wrote:

1) The reason I quited on the remakes on the Leisure suit Larry 3 was because there is so many stuff I can't handle with. So right now I am just practicing.

2) So yes I am still working on that game but I'm note sure any longer if I can release it out. It could be very risky as you all know.
i am confused.....

Posted: Wed Sep 08, 2004 9:54 pm
by Fribbi
Alright!

I'm just drawing the backgrounds for that game. But because I don't know much about the AGS codes it could be very difficult for me to work on this game alone with such bad knowledge on this thing.

I should had start to make a tiny little game with all my skills I have gained before I begin on that huge difficult game like Leisure suit Larry 3. but since I'm already started on that I have to finish that first, right guys?

Rigth now I need a code for the Patti like when she is riding that lumber on the stream.

I still need a code for how to display a message how many of the same item I have like: "You have 5 dollar" and when I pay one dollar I want to display a message "You have have 4 dollar left" I also want to know what code should I use when I gain a dollar and display a message like "You have 1 dollar. "You have 2 dollar" and etc etc.

Posted: Wed Sep 08, 2004 11:14 pm
by 1eyedParrot
num=5;
Display("You have %d dollars.", num);
if(run_plot_payonedollar==1)
{num--;Display("You have %d dollars.", num);}
if(run_plot_gainonedollar==1)
{num++;Display("You have %d dollars.", num);}

Fairly standard stuff.

Posted: Thu Sep 09, 2004 4:46 am
by Erpy
Rigth now I need a code for the Patti like when she is riding that lumber on the stream.
Ooooh...arcade sequences. I suggest not starting on those until you have a stronger grasp of the scripting language. Sequences like these usually involve a lot of code.

Image

Posted: Thu Sep 09, 2004 10:34 am
by Fribbi
Finally! The answer I have been waiting after in one month has arrived! :D

Thanks Erpy too. ;)

Well I dunno if I have enough time for the code for the Patti on the lumber. But I'm the most patience guy here since I'm still waiting for my "payment" for the translating work I did for the KQ1 I have wait and wait after it for 3 years now. And I guess I have to wait another year for that from AGDI girl. I just hope she has not forgot that promise now.
:cry

Posted: Fri Feb 04, 2005 4:29 pm
by Fribbi
Ok I am trying again to make a game again and in this time it will be original but with old familar Sierra characters so I need help with this one.

And the question is all about times.

1.  If I want some events happen on the right time like in the Colonel Bequest. What is the code for that?

2.  Lets say I was working on LSL1VGA and as you know the first screen would be in front of the Lefty bar and Larry hasn't doing anything else but stand alone in same place and suddenly a ugly black dog walks to him an pee on him. And after that he keeps continue on his way from right to left and if Larry are still standing in the same place the dog walks from left to right only to pee on Larry.  I need code how to do something like that.

4.  If I was holding on a timebomb and I have to shut it off before the times go away.  What code shall I use for that?

5.  Ok let say if I was talking to Erasmus from Quest for glory games and I get a message that I should wait to talk to him so he can finish his coffee.
What code shall I use'

Ok I have no more question now but I hope you could understand me.

And oh wait I almost forgot this one.

What is the code for letting a game character duck and defend himself before it will be hit by dagger or sword or magic hit to prevent it from being killed like in Quest for glory games?

I also need a useful codes for if I want the character to hit a right target and also a moving  targets where it is pointing at and also a useful code for the scorepoints wich display the points.

Posted: Tue Feb 08, 2005 4:12 pm
by Fribbi
:rolleyes Hmm How long am I suppose to wait for this codes in this time? :lol  :p

Posted: Tue Feb 08, 2005 5:46 pm
by 1eyedParrot
Fribbi wrote:Ok I am trying again to make a game again and in this time it will be original but with old familar Sierra characters so I need help with this one.

And the question is all about times.

1.  If I want some events happen on the right time like in the Colonel Bequest. What is the code for that?

2.  Lets say I was working on LSL1VGA and as you know the first screen would be in front of the Lefty bar and Larry hasn't doing anything else but stand alone in same place and suddenly a ugly black dog walks to him an pee on him. And after that he keeps continue on his way from right to left and if Larry are still standing in the same place the dog walks from left to right only to pee on Larry.  I need code how to do something like that.

4.  If I was holding on a timebomb and I have to shut it off before the times go away.  What code shall I use for that?

5.  Ok let say if I was talking to Erasmus from Quest for glory games and I get a message that I should wait to talk to him so he can finish his coffee.
What code shall I use'

Ok I have no more question now but I hope you could understand me.

And oh wait I almost forgot this one.

What is the code for letting a game character duck and defend himself before it will be hit by dagger or sword or magic hit to prevent it from being killed like in Quest for glory games?

I also need a useful codes for if I want the character to hit a right target and also a moving  targets where it is pointing at and also a useful code for the scorepoints wich display the points.
#1
Write a time cycle and set a counter(with conditions) to activate the event. Or set a condition to activate an event off the completion of another event.

#2
In the repeat function of the room write a cycle that just has the character[dog] moving to some character[larry].x and .y and peeing, then move to the edge of the screen.

[NOTE] You Skipped #3

#4
Very simple, write a function in global and call the function in the repeat function of the room, setup a counter and if some condition(bomb disabled, etc..) is not met then boom.

#5
Once again, call functions and use counters.

#6
This is just calling specific character loops from the views, using either constants or dynamic variables.

Posted: Thu Feb 10, 2005 11:23 am
by Fribbi
Thanks but I still need the code so I can know how to do this all.

Image

I haven't decide the name of this game but the first two idea which came into my brain was Rejunion Quest and the other was Quest for Questsgamesplayers.
I am going to include most of the famous classic Sierra characters in this game.

Posted: Thu Feb 10, 2005 1:23 pm
by Erpy
I think you're better off trying to build something yourself with aforementioned tips instead of waiting for someone to write the code for you, because it could be a long wait.

Image

Posted: Fri Feb 11, 2005 3:12 pm
by Fribbi
Yeah you are right like always. I will then try to do something else then.

               Image

Posted: Tue Feb 15, 2005 5:36 pm
by Fribbi
Does anybody know anything on that raining and snow plugin?

But I have some problem with the raining and snow plugin.

Always when I go in the room where the first raining room are with lots of raining and when I go to a another room where rain are not needed there the raining are still raining. I just want to let the rain come in certain places that's all.