Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Topics - Kurdt

#1
Here's the deal:

I've got a screen on which I'm showing my title card. When the game loads, it flashes a static "Kurdt's Awesome Game Production Company" (or whatever I name my brand) and plays a little piece of fanfare over it. When the music ends (aka it's not looped) I want to call the ChangeRoom function to move on. Is there a specific code I could use for this, a "Change room when the music stops" function I haven't found?

I've got a few theories that I haven't put into practice yet (I'm at work at the moment), but I'm just checking to see if there's a simpler way than how I'm thinking to do it.

This is how I've got it figured:

Code: ags
SetMusicRepeat(0);
PlayMusic(2);
Wait(360); //a 9 second piece of music
cEgo.ChangeRoom(1);


Is there some unknown way to do it simpler than that, without using the Wait function perhaps?
#2
I've got a post over in the Beginner Forum about creating a custom Save/Load GUI and I got a pretty good amount of help over there. CMK recently posted a tutorial in the AGS Wiki about it and that solved basically all anomalies. However, when overwriting a save game it only checks against the SelectedIndex save to see if they're the same name. If the save you want to overwrite isn't selected, it won't be overwritten and there will be two saves with the same name. Since this is ridiculously confusing and annoying, I'm trying to get this to go away.

This led me to thinking about the nature of save games. How exactly do they work? Rather, what is their nature? How do they save their name? How do they get called up? I was thinking if I better understood the fundamental nature of a save game that I could come up with my code better. I asked it in the previously mentioned thread, but it's been some time now and I was just thinking that maybe someone who frequented this forum as opposed to the n00b one might have an answer, or at least a theory.
#3
I used ListBox.FillSaveGameList(); code in my custom Save GUI's list box and it works fine, but when I do the same thing for my Restore GUI's list box, I get nothing. I've checked and double-checked and triple-checked the code and it should be working, but it just doesn't fill my load list with saves. What gives?

On another note, I've been trying to get my Save GUI to overwrite save games if the input to the Text Box is the same as the name of a previously saved game (In the Sierra style). I've got this code:

Code: ags

int saves;

#sectionstart SaveButton_Click//SAVE BUTTON IN THE CONTROL PANEL GUI
function SaveButton_Click(GUIControl *control, MouseButton button)
{gControl.Visible = false;
gSavegame.Centre();
gSavegame.Visible = true;
saves = (SaveList.ItemCount);
if (saves > 19) {
  DisplayMessage(990);
  }
}
#sectionend SaveButton_Click//SAVE BUTTON IN THE CONTROL PANEL GUI

#sectionstart SavegameButton_Click  // DO NOT EDIT OR REMOVE THIS LINE
function SavegameButton_Click(GUIControl *control, MouseButton button) {
String input = SaveText.Text;
String item = SaveList.Items[SaveList.SelectedIndex];
if (input.CompareTo(item) == 0) { // i.e. strings match
SaveGameSlot(SaveList.SelectedIndex, SaveText.Text);
}
else {
SaveGameSlot(saves, SaveText.Text);
SaveList.AddItem(input);
}
gSavegame.Visible = false;
gIconbar.Visible = true;
}
#sectionend SavegameButton_Click  // DO NOT EDIT OR REMOVE THIS LINE

However, every time I try to save a game with this code, the game crashes and tells me I've got an "invalid index specified." I've scoured the manual, this thread and this thread, but I've still come up with nothing. What's the story here?

I swear to God if I ever get this down I'm making a tutorial. No one should have to search as much as I did for anything regarding this engine, much less something so universally desired as custom Save and Load GUIs.
#4
I want to get my game to have GK1-style dialogue pics, with two headshots on either side of a black background and a set of talk options between them. You click on the talk options and messages play, etc. etc. I'm sure we've all played GK1 and know what I mean.

I saw a template for this on the AGS Resources page, but when I downloaded it AGS wouldn't recognize the template. I put it in the same folder as all the other templates but it just wouldn't register its existence.

Does anybody else have this template that I might try it again? Or at least show me how to do it myself? Perhaps the one I downloaded was faulty. It didn't have a "Does not work with 2.7 and above" tag on it, so it should be fine.
#5
Okay, so I've read the manual, sifted through tutorials, asked my friends, and done searches on this site regarding my problem, so now I'm posting. I'm trying to get a slider that controls my speed on my control panel GUI, and I've written script like this:

#sectionstart SliderSpeed_Change//SPEED SLIDER
function SliderSpeed_Change(GUIControl *control, MouseButton button)
{SetGameSpeed(SliderSpeed.Value);}
#sectionend SliderSpeed_Change//SPEED SLIDER

Where SliderSpeed is the name of my slider. According to my understanding of the manual, this is how you do it. However, when I attempt to use the slider ingame, I crash and it throws up this error:

Error: run_text_script1: error -1 running function 'SliderSpeed_Change':
Runtime error: wrong number of parameters to exported function 'SliderSpeed_Change' (expected 2, supplied 1)

Is this a bug in AGS or is there something I'm missing in my n00bness?

It should also be known that when I use SetGameSpeed elsewhere (like in game_start) and supply it with an actual number (in this case 60), it works exactly like it should. What am I doing wrong here?
SMF spam blocked by CleanTalk