Neat AGS codes collection.

This is a public forum, where you can find out everything you wanted to know about making games. Please don't use this forum as a place to recruit new members.

Moderators: adeyke, VampD3, eriqchang, Angelus3K

Message
Author
User avatar
Fribbi
The Icelandic Guest
Posts: 1696
Joined: Thu Aug 09, 2001 7:49 pm

Neat AGS codes collection.

#1 Post by Fribbi » Sat Aug 21, 2004 12:47 am

I made this thread so you can share some useful AGS codes here. So if you got one please put it here. Thanks. :D

LucasFan
Royal Servant Status
Posts: 89
Joined: Sun Apr 25, 2004 8:19 pm
Location: Germany
Contact:

#2 Post by LucasFan » Sat Aug 21, 2004 5:56 am

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. ;)

Klytos
Infamous Sheik of Australia
Posts: 1722
Joined: Tue Apr 22, 2003 3:43 pm
Location: Rockhampton Australia
Contact:

#3 Post by Klytos » Sat Aug 21, 2004 7:36 am

:rollin

Erpy
Forum Administrator
Posts: 11434
Joined: Tue Sep 25, 2001 8:28 pm
Location: The Netherlands

#4 Post by Erpy » Sat Aug 21, 2004 9:33 am

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

Jafar
Super Star
Posts: 1128
Joined: Sun Jan 19, 2003 12:31 pm
Location: Lemming land
Contact:

#5 Post by Jafar » Sat Aug 21, 2004 2:57 pm

I never noticed that code button before...

Code: Select all

Ecret-Say Ode-Cay!
:p

Erpy
Forum Administrator
Posts: 11434
Joined: Tue Sep 25, 2001 8:28 pm
Location: The Netherlands

#6 Post by Erpy » Sat Aug 21, 2004 4:03 pm

Rather than going further OT, what kind of code were you looking for Fribbi?

Image

User avatar
Fribbi
The Icelandic Guest
Posts: 1696
Joined: Thu Aug 09, 2001 7:49 pm

#7 Post by Fribbi » Sat Aug 21, 2004 5:11 pm

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.

User avatar
Fribbi
The Icelandic Guest
Posts: 1696
Joined: Thu Aug 09, 2001 7:49 pm

#8 Post by Fribbi » Mon Aug 23, 2004 6:35 pm

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.

Erpy
Forum Administrator
Posts: 11434
Joined: Tue Sep 25, 2001 8:28 pm
Location: The Netherlands

#9 Post by Erpy » Mon Aug 23, 2004 6:40 pm

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

1eyedParrot
Knight Status
Posts: 160
Joined: Wed Mar 03, 2004 1:44 pm
Contact:

#10 Post by 1eyedParrot » Mon Aug 23, 2004 8:28 pm

Use the function repeatedly_execute_always(), although remember not to use blocking functions with it.

User avatar
Angelus3K
Vampiric Moderator
Posts: 3968
Joined: Wed Feb 05, 2003 6:54 am
Location: Newcastle, UK
Contact:

#11 Post by Angelus3K » Mon Aug 23, 2004 9:00 pm

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 ;)

User avatar
Fribbi
The Icelandic Guest
Posts: 1696
Joined: Thu Aug 09, 2001 7:49 pm

#12 Post by Fribbi » Wed Sep 01, 2004 9:03 pm

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.

1eyedParrot
Knight Status
Posts: 160
Joined: Wed Mar 03, 2004 1:44 pm
Contact:

#13 Post by 1eyedParrot » Wed Sep 01, 2004 9:16 pm

Many of the functions and variables and explained in the help file. If you want help you need to be more specific about it.

Zeus
Knight Status
Posts: 234
Joined: Tue Nov 26, 2002 2:37 pm

#14 Post by Zeus » Thu Sep 02, 2004 6:54 am

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.....

User avatar
Fribbi
The Icelandic Guest
Posts: 1696
Joined: Thu Aug 09, 2001 7:49 pm

#15 Post by Fribbi » Wed Sep 08, 2004 9:54 pm

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.

1eyedParrot
Knight Status
Posts: 160
Joined: Wed Mar 03, 2004 1:44 pm
Contact:

#16 Post by 1eyedParrot » Wed Sep 08, 2004 11:14 pm

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.

Erpy
Forum Administrator
Posts: 11434
Joined: Tue Sep 25, 2001 8:28 pm
Location: The Netherlands

#17 Post by Erpy » Thu Sep 09, 2004 4:46 am

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

User avatar
Fribbi
The Icelandic Guest
Posts: 1696
Joined: Thu Aug 09, 2001 7:49 pm

#18 Post by Fribbi » Thu Sep 09, 2004 10:34 am

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

User avatar
Fribbi
The Icelandic Guest
Posts: 1696
Joined: Thu Aug 09, 2001 7:49 pm

#19 Post by Fribbi » Fri Feb 04, 2005 4:29 pm

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.

User avatar
Fribbi
The Icelandic Guest
Posts: 1696
Joined: Thu Aug 09, 2001 7:49 pm

#20 Post by Fribbi » Tue Feb 08, 2005 4:12 pm

:rolleyes Hmm How long am I suppose to wait for this codes in this time? :lol  :p

1eyedParrot
Knight Status
Posts: 160
Joined: Wed Mar 03, 2004 1:44 pm
Contact:

#21 Post by 1eyedParrot » Tue Feb 08, 2005 5:46 pm

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.

User avatar
Fribbi
The Icelandic Guest
Posts: 1696
Joined: Thu Aug 09, 2001 7:49 pm

#22 Post by Fribbi » Thu Feb 10, 2005 11:23 am

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.

Erpy
Forum Administrator
Posts: 11434
Joined: Tue Sep 25, 2001 8:28 pm
Location: The Netherlands

#23 Post by Erpy » Thu Feb 10, 2005 1:23 pm

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

User avatar
Fribbi
The Icelandic Guest
Posts: 1696
Joined: Thu Aug 09, 2001 7:49 pm

#24 Post by Fribbi » Fri Feb 11, 2005 3:12 pm

Yeah you are right like always. I will then try to do something else then.

               Image

User avatar
Fribbi
The Icelandic Guest
Posts: 1696
Joined: Thu Aug 09, 2001 7:49 pm

#25 Post by Fribbi » Tue Feb 15, 2005 5:36 pm

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.
Last edited by Fribbi on Sat May 21, 2005 5:54 pm, edited 1 time in total.

Post Reply