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

#1601
I've added in both of the codes into the global script, but I'm a little confused. Is the 'hs' just used as an example, or does it have an important function to it? I'm guessing I enter the first block into the global script, under repeatedly execute or something. Sorry about this, but I need just a little more explanation for it to register with me. Thanks for helping me.
#1602
Hullo.

I'm using a list box GUI at the bottom to display everything the player looks at. It works fine, but the code that you have to write for it is long and will slow up the game if I have to do it for every hotspot. Here's the code I use at the moment:

Code: ags
function hHotspotX_Look ()
{
   int ran=Random(4);
   if (ran==0) {
      DisplayBox.ScrollDown();
      DisplayBox.AddItem ("You got the first phrase.");
}
   else if (ran==1){
      DisplayBox.ScrollDown();
      DisplayBox.AddItem ("You got the second phrase.");
}
   else if (ran==2){
      DisplayBox.ScrollDown();
      DisplayBox.AddItem ("You got the third phrase.");
}
   else if (ran==3){
      DisplayBox.ScrollDown();
      DisplayBox.AddItem ("You got the fourth phrase.");
}
   else if (ran==4){
      DisplayBox.ScrollDown();
      DisplayBox.AddItem ("You got the fifth phrase.");
   }
}


Like so. Now if I had to do this I'd need to enter all this (or copy and paste) for every single hotspot. Is there a way I can simplify it by making my own custom code? I've looked into structs but I don't know where to start.

Thanks.


#1603
 :) No wonder it didn't work! :) (Pseudo code?)
I'd better edit my original post so nobody else sees my embarrassing mathematical blunder.

Thanks!
#1604
Yes to the first point. You can really abuse AGS :) If you make the character sprites overhead, then you can do whatever you want. You could change it into a non-point and click engine by just using keyboard commands.

I feel I've missed your point but oh well. I think there may be a 3D plugin or something, but somebody else is going to have to answer the other two for you  :)
#1605
Hullo. Sorry for posting twice in the same day.
I've sorted out a list box GUI at the bottom of the screen that displays everything the player's done, such as looking at something or "You picked up X item." and such.

Anyway, I don't want it to display everything since they began playing, so I'm trying to find a way to delete the items at the top of the list box (the ones less recent) if the number of things registered reaches 25, for example. Here's the code I've come up with:

if (ListBox.ItemCount <25) {
   ListBox.RemoveItem(0);
}

I've bunged this under game_start like I do with most things. When I run the game, the yellow box thing comes up and points at the second line - which I've highlighted in blue - and says 'ListBoxRemove: invalid listindex specified.' I have a feeling I have to create a global variable, but what's wrong?

Thanks in advance.
#1606
Cool thanks! I've got it to work now.

Honestly if there wasn't a help forum I'd probably give up. (Eventually :))
#1607
I think now's the time to get my own GUI for the input.
The line in my global script is this:

player.Name = Game.InputBox ("!Type your name. You can't change this later!")

This works fine, but I want to change the cutom box that comes up. I've already got a TextGUI ready for use (GUI id 11), but how would I use this? Do I need to change "Game.InputBox" bit?

Also, will the text box and buttons appear that are on the custom input box? Thanks. 
#1608
Thanks!
#1609
Woops. Looked through the rest and realised I probably shouldn't have said that.
#1610
The Rumpus Room / Re: How did you find AGS?
Thu 21/05/2009 19:43:26
I was looking at an article on HowStuffWorks about amatuer computer programming and it listed a few. AGS was the one that stood out to me. I downloaded it the same day  :)
#1611
Yes, it comes with AGS. Press F1 when you're working on your game and it will pop up.
#1612
This thread has just under gone a much-needed update with new graphics.  :)
#1613
No on second thoughts I'll leave it. The grey's quite nasty but I'll leave it until later. Thanks for all your help on this - my games will go from rubbish to average now!  :)
#1614
It works! Thanks for all your help guys. (or girls!)  :)

Just to finish, how would I create a custom GUI to enter it into?
#1615
It's asking me for a string buffer. What's a string buffer?  :-\
#1616
Well, the text box is on a 'New Game' GUI but yes it's in the first room.
#1617
I've added a global variable (my first  :)) and the name is 'player_name', and the type is String. What do I need to do about the initial value? I had a look in the manual like Trent suggested but it has funny examples which I don't understand.

Sorry for not getting it. I would use the excuse that I'm only a beginner but I've had AGS for ages so...
#1618
Kool thanks. I haven't tried it yet but I'll do it now.
#1619
*Please read the last post for my new query.*

Hullo.

How would I go about adding a function into my game that can allow the player their own name? When they choose to start a new game, a text box appears and the player can give themselves a name, and that name is used throughout the game, such as displayed on the status bar or mentioned when they talk to people. I've got a feeling that % can help. Am I right?

Thanks  :)
#1620
Now I don't have to type out all of the keys.  :) Thanks!
SMF spam blocked by CleanTalk