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

Messages - Kurdt

#1
Oh my God. Does that mean I might actually understand something in AGS? I don't think I can do this anymore. ;D
#2
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?
#3
I guess like most other people I'm amazed this is out already. I guess I don't really frequent places where there would be anything in the way of news updates for the game, so I had no idea as to how far along (or if it was going along at all) the game was. I haven't downloaded it yet, but I'll do so the first chance I get and let you know what I think. Congrats on adding another cool game on the pile of indie adventures. There's nothing quite like the completion of something you've spent a lot of time working on.
#4
Anyways, join the team! It ought to be tons of fun if you can handle a little hard work and a lot of clowning around. This should be one hell of an awesome remake.
#5
Well, since CMK updated his tutorial on the Wiki, I basically copied and pasted his code in there and got it working. I mean, I looked at it and made sure I understood exactly what the code was calling for, but that's the code I used. I didn't use yours because I'd already had CMK's by the time I saw it. I mean, I'll plug it in for a lark and see if it works if you'd like. I don't see any reason why not to if I've got time to kill and feel like nerding out on programming code. *shrug*
#6
I think it just depends on what you want your game to be like. I'm striving for that classic Sierra GUI and this was how I always figured they'd done it. If I was to do it in a different style for one reason or another, I might choose to have multiple saves with the same name. However, at present that is not the way I roll.

I'm personally quite glad someone finally made a tutorial for this. For something so widely desired as a custom Save/Load GUI, it seems there's absolutely nowhere a n00b can learn how to do this. I was planning on writing a tutorial of my own when I had it down, and now I don't have to because there's a great one now.
#7
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.
#8
Okay, I can only assume that the suggested code doesn't work at all, because it still only compares against the SelectedIndex property.

Can somebody explain to me the exact property of a savegame? For example, how does it remember its name, how does FillSaveGameList call up that name, etc.? How do savegame files in and of themselves work, essentially? What's the concept behind them?
#9
Good tutorial and it definitely helped me a lot, but like you said it's got the fatal flaw of only checking against the hilighted save. I'm going to make an attempt at merging your code with GG's code and see if I can get something working.
#10
I took away the = and it eliminated the invalid index error, but nothing still happens when I try to save. I put the old code back in and I still overwrite the SelectedIndex save regardless of whether or not it's the same text. To top it off, it doesn't fill the SaveText box with the save's name when I select it. Here's the code as it is for my entire save apparatus:

Code: ags
int saves;
int currentsaveslot
bool foundsamename;

#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;
SaveList.FillSaveGameList();
saves = (SaveList.ItemCount);
if (saves > 19) {
  DisplayMessage(990);
  }
}
#sectionend SaveButton_Click//SAVE BUTTON IN THE CONTROL PANEL GUI

#sectionstart SaveList_SelectionChanged  // DO NOT EDIT OR REMOVE THIS LINE
function SaveList_SelectionChanged(GUIControl *control) {

}
#sectionend SaveList_SelectionChanged  // DO NOT EDIT OR REMOVE THIS LINE

#sectionstart SaveText_Activate  // DO NOT EDIT OR REMOVE THIS LINE
function SaveText_Activate(GUIControl *control) {

}
#sectionend SaveText_Activate  // DO NOT EDIT OR REMOVE THIS LINE

#sectionstart SavegameButton_Click  // DO NOT EDIT OR REMOVE THIS LINE
function SavegameButton_Click(GUIControl *control, MouseButton button) {
String input = SaveText.Text;
String item = ""; //to avoid errors in later part if the string remains null
while ((currentsaveslot < SaveList.ItemCount) && (foundsamename == false)){
    if (SaveText.Text == SaveList.Items[currentsaveslot])  foundsamename = true;
    else currentsaveslot++;
    }
if (foundsamename == true) SaveGameSlot(SaveList.SaveGameSlots[currentsaveslot], SaveText.Text);
if (input.CompareTo(item) == 0) { // i.e. strings match
SaveGameSlot(SaveList.SaveGameSlots[SaveList.SelectedIndex], SaveText.Text);
}
else {
SaveGameSlot(saves, SaveText.Text);
}
gSavegame.Visible = false;
gIconbar.Visible = true;
}
#sectionend SavegameButton_Click  // DO NOT EDIT OR REMOVE THIS LINE

#sectionstart DeleteSaveButton_Click  // DO NOT EDIT OR REMOVE THIS LINE
function DeleteSaveButton_Click(GUIControl *control, MouseButton button) {
DeleteSaveSlot(SaveList.SelectedIndex);
SaveList.FillSaveGameList();
}
#sectionend DeleteSaveButton_Click  // DO NOT EDIT OR REMOVE THIS LINE

#sectionstart CancelSaveButton_Click  // DO NOT EDIT OR REMOVE THIS LINE
function CancelSaveButton_Click(GUIControl *control, MouseButton button) {
gSavegame.Visible = false;
gIconbar.Visible = true;  
}
#sectionend CancelSaveButton_Click  // DO NOT EDIT OR REMOVE THIS LINE


As is seen, I'm toying around with deleting savegames as well. When I hit my delete button it deleted the saves just fine until there was just one save, then it wouldn't let me delete it and now it only overwrites that save. If I take all the code aside from the while statement out of the Savegamebutton part it doesn't do anything.
#11
I think I still have the old code in there as well and it may be getting confused. Once I get this invalid index thing fixed I'll eliminate that old code and see if it works. I'll be riiiight back!

EDIT: Well, I changed the "currentsaveslot" in the SaveList.Items property to "SaveList.SelectedIndex", but now it's not saving games at all. I click the save button and nothing happens. What exactly do you have in mind here for the Items property?

EDIT2:
QuoteHave you coded this yet? If so, when you select a slot SaveText.Text will be updated to the name of the selected game - so obviously it'll match, and the selected game will be overwritten.
GG said that the code to make that happen should be put in SelectionChanged, but I still have no idea what that code would even look like, so no I haven't coded that in yet.
#12
Hello, it's me again. I've been away doing real life crap and have only now been able to implement that code. At the moment I'm getting an error that says that "currentsaveslot" is undefined. I'm not quite sure what it should be defined AS, though. Do you have an idea? I literally copied and pasted the code in this thread.

EDIT: I noticed the code given to me was erroneous in that the while statement names "currentsavegame" and the int is currentsaveslot, so a quick name change fixed that. However, now it's telling me that SaveList.Items specifies an invalid index.

Also, it overwrites the save game that's selected regardless of whether or not the text in the TextBox is the same as the text selected. How do I get that to go away? I only want it to overwrite a save game if the text in the text box matches the text of a game saved, and if a save game is selected it fills the text box with its text.
#13
Really? Awesome! That's what I'd like to get done as well. In the meantime, I'm going to implement that new code and see what it do.

Thanks for all your help, by the by.
#14
Ah, well, there you go. What the hell do I need the SelectionChanged section for, then, anyway?

Still trying to figure out the text box thing...
#15
I have it in the SaveList_SelectionChanged section. I didn't copy/paste it here because it didn't seem important. Should I even bother with having a section for that if I'm going to put it somewhere else?

EDIT: I put the FillSaveGameList code where you said and it worked (filling the RestoreList as well). However, I've still got that problem where it won't let me select any save but the very first one and it won't overwrite a game that's not selected, regardless of whether or not the input to the SaveText box is the same as the save's name. How do I rid myself of this?
#16
The AddItem is meant to add the new save to the list when the player saves a new game. How does FillSaveGameList add a new save to the list?

And at this particular moment, I have no games saved so I'm not able to have anything selected since nothing exists yet. I'm just trying to save one game. I want the code to check to see if what's typed in the TextBox is the same as a previously saved game, perhaps the one that's selected. If it is, then overwrite. If it's not or there's no item selected, just save a new game.

And I did use FillSaveGameList earlier, in the SaveList section. It's saying that SaveGameSlot doesn't belong as a ListBox item. It only gave me that error when I typed in SaveList.SaveGameSlots. I see nowhere in the manual or any other FAQ that's ever used SaveGameSlot like that and plural.

Let me go punch that new stuff in and see what happens...

EDIT: That worked to save the game, but it's doing a strange thing with the box. I try to click on another save in the list to save over it and it won't let me. It highlights that save for a split second and then automatically goes the the top of the list. Sometimes when I click on an item it'll get pushed to the top of the list as well. I don't understand that.

Also, is it possible for me to make it to where if the words typed in the TextBox match up with any save game in the list, regardless of whether or not it's selected, it will overwrite that save?
#17
I'm getting the error at the "String item = SaveList.Items[SaveList.SelectedIndex];" line. I'll go punch in that code and see what happens.

EDIT: The code you gave me told me that "SaveGameSlots" (SaveList.SaveGameSlots[etc....) isn't a public member of ListBox. What did you mean to type there?
#18
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.
#19
Yeah, I have the full template as well, and I did end up downloading 2.62 from the Wiki and getting it through there. As you said, it's not very well-commented (and the manual for the full template is next to useless) and a lot of the code is still above my head, but it's pushing me in the correct direction. I hadn't even studied dialog_request yet, and I got it to take care of something I was getting "smash-my-monitor-with-my-fist" angry about (I wanted different font for a character speaking in another language and couldn't figure it out), so the download's already paying off, heheh.

I think when I get better at this I'm going to design my own GK1-style dialog, though. This one puts the speech text in weird places on the screen and I like using my own code anyway (I trust it more).
#20
Yeah, it's weird. Like I said, the site didn't say it had compatablility problems with 2.71 (it said so with others) and I know for sure it's in the right folder because I checked a good number of times over. I guess my comp just hates me, heheh. I'll see if I can download an older version and try it there. This kind of sucks because I'm basing my game around the GK1 dialogues and I want to know how to use them. Maybe CJ can integrate the plug-in someday and have it selectable like the other dialogue types are. *shrug* Oh well.
SMF spam blocked by CleanTalk