AGS: Can I Make an RPG with AGS?

Started by TerranRich, Mon 03/05/2004 05:56:47

Previous topic - Next topic

Trent R

Shame. I saw a new reply to this thread and thought it was something exciting....

Actually, I was going to post some progress of my RPG/Hybrid, to give others ideas. Just have to take the time to do it..


~Trent
To give back to the AGS community, I can get you free, full versions of commercial software. Recently, Paint Shop Pro X, and eXPert PDF Pro 6. Please PM me for details.


Current Project: The Wanderer
On Hold: Hero of the Rune

Takyon

lol sorry to disappoint Id just read most of the thread and felt I needed to ask the question :)
ghost.

Ghost

And to answer it, yes you can. The technology is there, all you need to do is create quality content. I think I remember there is a Broken Sword 1 1/2 game available- made with AGS.

Sorry for the thread hijack.

Takyon

Thanks Ghost sorry I'm very much a "newb" still. Oh yeah I think you might mean broken sword 2.5 www.brokensword25.com.
Looks very good but as you you get further in the game the plot becomes rather ridiculous lol
ghost.

Takyon

Can I use voice overs and voice acting etc with AGS or do I have to download a new program to incorperate it with AGS?

E.G. I've recorded the voice in cubase etc and want it to work when I look.
ghost.

Ghost

Not too sure about cubase, but you can indeed use voiceovers with AGS. WAV, OGG and MP3 are supported. Basically you record your speech and, instead of simple Say commands, enter something like
cEgo.Say("&10 Hi! How are you?");
...where a file ego10.wav would be played.

Enter the keyword "speech" in the AGS manual to find a more elaborate description, but as you see, it's possible to do voice acting in AGS.

Takyon

ghost.

Dualnames

Quote from: J Skeng on Sat 14/03/2009 13:42:19
Thanks ghost great help :)

In a suggestion music thread (just a week topic) Chris said he'll put a function to play a certain speech file, so you might want to wait a bit before start numbering and all. Just a thought.
Worked on Strangeland, Primordia, Hob's Barrow, The Cat Lady, Mage's Initiation, Until I Have You, Downfall, Hunie Pop, and every game in the Wadjet Eye Games catalogue (porting)

Takyon

Ahh thanks dualnames I'll wait a wile then.
ghost.

Shockbolt

How would one go about, creating a game having a code that changed day into night and the other way around, and also having something that would allow for the game to change seasons (summer, autumn, winter, spring)?

The scenes will change accordingly to the above, and the player should be able to have an option to sleep/rest to speed things up.

I've gone through the tutorials, read up on several website (with old codes that don't help me much now)
I'm reading the manual now, but for a graphic artist, it's mighty tough to understand how it all fits together. I mean, I could aswell have been studying advanced chinese, I don't think it'd be much more difficult than this :)

Khris

AGS allows up to five background frames for each room; instead of using them for constantly animating the background, you can switch between them, so that's how I'd go about having four seasons in each room.

The best way to accomplish a day-night-cycle depends on how sophisticated you want it to look.
A very easy way is to use a semi-transparent, black (or slightly bluish), non-clickable GUI.

If you want to use different background images for day & night, you have to use two rooms per location (since you'd need 8 background frames then).

The technical side is comparatively easy; each room has a before fadein event, in there you'd check the current season (stored in a global variable), then change the room background accordingly.

Shockbolt

Quote from: KhrisMUC on Thu 26/03/2009 10:35:21
AGS allows up to five background frames for each room; instead of using them for constantly animating the background, you can switch between them, so that's how I'd go about having four seasons in each room.

The best way to accomplish a day-night-cycle depends on how sophisticated you want it to look.
A very easy way is to use a semi-transparent, black (or slightly bluish), non-clickable GUI.

If you want to use different background images for day & night, you have to use two rooms per location (since you'd need 8 background frames then).

The technical side is comparatively easy; each room has a before fadein event, in there you'd check the current season (stored in a global variable), then change the room background accordingly.


Thanks, but what if I wanted the game itself to handle the transitions between seasons and day/night, by how much real-time You're spending in the game:

For example 20 minutes in realtime would be the lenght of the day or night in the game, 4 hours in realtime would be the lenght of one season (I might end up using just summer/winter for the first version of the game)


I seem to remember that in the Quest for Glory 1 game, day and night occured on a regular basis.

Khris

There's a function called repeatedly_execute() in the global script that is called 40 times per second (40 is the default value, the current setting can be obtained using GetGameSpeed()).

You'd use a variable to count minutes:

Code: ags
// above rep_ex

int timer, minutes; // declare two variables, intial value is 0

// inside rep_ex

  timer++;
  if (timer == GetGameSpeed()*60) {   // one minute of real-time has passed
    minutes++;  // increase minute counter
    timer = 0;    // reset timer

    if (minutes%20 == 0) SwitchDayNight();  // cull custom function that handles day/night

    if (minutes == 60*4) {  // four hours of real-time have passed
      AdvanceSeason();   // call custom function that advances to next season
      minutes = 0;  // reset minutes
    }
  }

Shockbolt

Quote from: KhrisMUC on Thu 26/03/2009 11:28:29
There's a function called repeatedly_execute() in the global script that is called 40 times per second (40 is the default value, the current setting can be obtained using GetGameSpeed()).

You'd use a variable to count minutes:

Code: ags
// above rep_ex

int timer, minutes; // declare two variables, intial value is 0

// inside rep_ex

  timer++;
  if (timer == GetGameSpeed()*60) {   // one minute of real-time has passed
    minutes++;  // increase minute counter
    timer = 0;    // reset timer

    if (minutes%20 == 0) SwitchDayNight();  // cull custom function that handles day/night

    if (minutes == 60*4) {  // four hours of real-time have passed
      AdvanceSeason();   // call custom function that advances to next season
      minutes = 0;  // reset minutes
    }
  }


Thank You! Simply amazing, I don't know if I'll ever be able to do stuff like that.
I mean, my brain hurts just by looking at the codes above, trying to understand how on earth one is able to understand and know when to put everything together
and make stuff work like You want it to. *sighs*

Shockbolt

#254
Well...I'm stumbling along after a computercrash last night which ruined my progress so far with my game..
Starting all over again is so fun :)

I've been going through the tutorials, manual, forum and other websites such as:

http://www.geocities.com/akk13us/rpg-tuto.htm

My problem is that I want my adventure/rpg to have a handful of stats that can be affected all over the gameworld.
These are : Alchemy, Coins, Fatigue and Hunger.
These should be GlobalInt's and be constantly updated and shown in the GUI 0 : gStatusline.

Lets focus on just one of the stats: Alchemy, as I'll be able to cope with the others based on the help I'll get with that one.

in GUI 0 : gStatusline , I've made two labels : label 1 shows text "Alchemypoints:" , label 2 shows "..."

In the Global variables I've defined : "myAlchemypoints" "int" and the initial value of "5"

The problem appears when I test my game using these codes in the rep_ex :

  String Alchemy;
  String.Format(Alchemy, "%d", myAlchemypoint);
  Label.Text(0, 2, Alchemy);

The error message I get is:
GlobalScript.asc(62): Error (line 62): must have an instance of the struct to access a non-static member


Whatr am I doing wrong here?

------
Edit:

I actually found out myself in a reply that had escaped me in the first searches:

LabelAlchemy.Text=String.Format("Alchemypoints: %d", myAlchemypoint);

-------

Problem solved :)

Khris

It should be noted that this tutorial is really old and wasn't exactly perfect when it was published, either (sorry Gord).
You did a good job of adapting it to current script though. :)

For reference: String.Format returns the first parameter with the following ones inserted. So it is exclusively used to the right of a "=" or as parameter of another function.

Shockbolt

Quote from: KhrisMUC on Fri 27/03/2009 19:43:55
It should be noted that this tutorial is really old and wasn't exactly perfect when it was published, either (sorry Gord).
You did a good job of adapting it to current script though. :)

For reference: String.Format returns the first parameter with the following ones inserted. So it is exclusively used to the right of a "=" or as parameter of another function.

Thanks! a few days of studying code scripting for the first time can do wonders.
I just wish the manual would give more obvious examples as to what the more advanced commands do (going further than what's seen in the tutorial(s), examples that
are related to adventure games. Cuz frankly, it's a "hell" trying to imagine what the commands do, and which commands fit together and are appropriate for what You want to do.

That said, I think I've learned alot of what I need for my games just by visiting this forum for the last few days, and I guess I'll post some of the stuff I've made so far, if there's an appropriate thread for that in here somewhere.

tanito0

Could you help me? I'd like to make a limited space inventory. And also, how could I make my character have more than one of the same item?
Pixelado

Dualnames

Quote from: tanito0 on Sat 04/04/2009 14:09:00
Could you help me? I'd like to make a limited space inventory. And also, how could I make my character have more than one of the same item?

For the second question, there's a setting on the General Settings of the game, I can't recall, but it won't be tough to figure out, something with inventory items..Sorry for a non straight reply.
Worked on Strangeland, Primordia, Hob's Barrow, The Cat Lady, Mage's Initiation, Until I Have You, Downfall, Hunie Pop, and every game in the Wadjet Eye Games catalogue (porting)

Trent R

#259
For a limited space, a simple way would be to create a Global var in the Global Variables Pane. (I've called it InventoryCount)

Then in your global script, in the on_event function (if it doesn't exist, type it in--this is one of the few functions you are allowed to simply type in) add the following.
Code: ags
function on_event (EventType event, int data) { //like I said, if you already have it...
  if (event==eEventAddInventory) {
    if (InventoryCount>=10) { //if you want a limit of 10
      player.InventoryQuantity[inv[data]]--; //this is in case you've reached the limit, it manually removes it
      return;
    }
    else InventoryCount++;
  }
}
  if (event==eEventLoseInventory) {
    InventoryCount--;
  }
}


If you read the manual entry of InventoryQuantity, it tells you that you should use AddInventory and LoseInventory, which you should. InventoryQuantity doesn't call the on_event, which is what you need to keep the limit. Therefore, if you need to add large amounts of Inventory (though I don't see why), you would need to use a while loop.


That should work. Another way would be to keep track of an InventoryItem array (I did that in my unreleased RingInv module, which replaces the normal InvWindow control into a SOM style Ring). But it is more complex, so only if you have a good reason.

~Trent
To give back to the AGS community, I can get you free, full versions of commercial software. Recently, Paint Shop Pro X, and eXPert PDF Pro 6. Please PM me for details.


Current Project: The Wanderer
On Hold: Hero of the Rune

SMF spam blocked by CleanTalk