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

#1
My game keeps crashing and I know why.  However, I don't know how to fix the problem.

In my game, I want the graphic of the currently active item to change if i press on the look button.
If no item is active however,  the game will crash.


Code: ags

//Somewhere in GlobalScript.asc

function blook_Click(GUIControl *control, MouseButton button) { 
mouse.Mode = eModeLookat;
inventory[game.inv_activated].Graphic = 78;
}


I tried doing the following,  but it did not work:

Code: ags

//Somewhere in GlobalScript.asc

function blook_Click(GUIControl *control, MouseButton button) { 
mouse.Mode = eModeLookat;
     
      if (game.inv_activated != null){
      inventory[game.inv_activated].Graphic = 78;
      }
}


I get "Type mismatch: cannot convert 'int' to 'null*'"

Is there a way to make AGS check if there's a currently active item?



#2
I looked everywhere for a solution to my problem,  but I couldn't find one.  Anyways...


I want the graphic of an inventory item to change when it is selected.  This is so that the player knows which inventory item is selected (the game does not use inventory cursors). 

I don't know what details to provide,  but here are some details anyways:

iPencil =  Name of inventory item ("Normal" graphic slot is 46  -  The desired "selected" graphic slot is 48) 
cPlay = Player character (Note:  I plan to have many player characters in the game)

Please tell me if I am missing any necessary details.


Thank you in advance.

#3
I made an object that would animate at different times according to a script.   The object animates the first time, but it doesn't the second.

This is my script:

Player enters room (Before fading)
Code: ags

object[0].SetView(3);Ã,  Ã,  Ã,  Ã, //Object 0 is set to View 3


Player enters room (After fading)
Code: ags

object[0].Animate(0, 2);Ã,  Ã,  Ã, //Object 0 is animating using "loop 0" with a delay of 2.Ã,  
object[0].Visible=false;Ã,  Ã,  Ã,  //Object 0 is now invisible. 
gExample.Visible = false;Ã,  Ã, //GUI example turns off. 
gOther.Visible = true;Ã,  Ã,  Ã,  Ã,  //GUI other turns on.
TypeLine("This is my script.");Ã,  Ã, //A line is being typed in gOther.
wait_click();Ã,  Ã,  Ã, Ã, Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã, Ã,  //AGS awaits the player's click.
TypeLine("This is text");Ã,  Ã,  Ã, Ã,  Ã,  Ã,  Ã, //A line is being typed in gOther.
wait_click();Ã,  Ã,  Ã, Ã,  Ã, Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã, //AGS awaits the player's click.
TypeLine("AGS is great!");Ã,  Ã,  Ã,  Ã,  //A line is being typed in gOther.
wait_click();Ã,  Ã,  Ã, Ã, Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã, //AGS awaits the player's click.
object[0].Visible=true;Ã,  Ã,  Ã,  Ã, Ã,  Ã,  Ã,  Ã, //Object 0 is now visible. 
object[0].Animate(2, 2);Ã,  Ã,  Ã,  Ã,  Ã,  Ã, //Object 0 should animate using loop 2 with a delay of 2. 
SetBackgroundFrame(1);Ã,  Ã,  Ã,  Ã,  Ã, Ã, //Changes the background to frame 1 
object[0].Animate(0, 2);Ã,  Ã,  Ã,  Ã,  Ã, Ã,  //Object 0 is animating using "loop 0" with a delay of 2.
object[0].Visible = falseÃ,  Ã,  Ã,  Ã,  Ã, Ã,  Ã, //Object 0 is now invisible. 


When it gets to the second animation, the first frame of the loop appears, but it doesn't animate.Ã,  Ã, 
#4
I need a MIDI to WAV, MP3 or OGG converter that would convert the exact length of the song.Ã,  I have a MIDI converter, but it adds a half second to the end. This would cause a small gap in the music for my adventure game.

:) Thank you.
#5
Is there any way to make the "wait" cursor animate?  I've searched everywhere and I can't seem to find a solution.
#6
Alright,

I do not know how to use the typeline function, at all.Ã,  I am displaying text using a label inside of a GUI, like so:


textlabel.SetText("This is called text!");


Can anyone tell me what to do in order make a simple typewriting effect.

P.S. I've seen the original Typeline function before.


#7
Is there a way to pause the script until the player or user clicks?

I am looking for a function similar to WaitMouseKey, without the timeloops.
#8
I have two questions:

First of all, I want the speech text to appear in a small box at the bottom of the screen.  Kinda like a text window, but I don't want the window to change it's size depending on the amount of text written.  How can I do that?

Second, is it possible to make the text gradually appear, one letter at the time?

All I want is a kind of "RPG-style" speech.


#9
Is it possible to have multiple inventories for "one" player character?

I'm making a game that has multitiple catagories.Ã,  For example: Foods, Tools, Papers, etc...Ã,  Every object that you pick up will end up in one of the catagories.

If it's possible to have multiple inventories(catagories) for "one" player character,Ã,  what should I do?
#10
General Discussion / Use Eyetoy as a webcam
Wed 08/02/2006 05:07:45
This is really old, but if you've never tried it, you can use a Sony Playstaion2 Eyetoy as a webcam!

The image quality of an Eyetoy is way better than the one of a regular webcam:

Regular webcam:Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã, Eyetoy:
Ã,  Ã, 


Here's a link to download the Eyetoy driver:
http://www.ionstorm.co.uk/files/sairuk/index.shtmlÃ, 
#11
I created my own GUI for the inventory. When I play the game,
the iventory window doesn't display more than one item, so
every time I pick an object up, it doesn't appear in the window.
#12
I'm trying to play a sound (sound02.mp3) in my game, but when I test it, AGS tells me that it's unable to play sound02.wav. Of course AGS won't be able to play that file since it doesn't exist. I'm trying to play "MP3" file. In the manual, it says that AGS will look for SoundX.wav, SoundX.mp3, SoundX.ogg, etc... Why doesn't it recognize my sound file.

Can anyone help me?
#13
How can I count the number of inventory items in a "inventory window"?
I'm looking for something that would act like: "if (whatever.ItemCount > 0)", but for inventory items.


How would I do that?
#14
I tried this on four different Googles and I keep getting the same result.  It's pretty funny if you think about it.

Type in "failure" and press on "I'm feeling lucky".

What do you get? Can it be? Is it true? Failure! Funny!

No need to check the entire site.  Just look at who they're talking about.

----------------------------------------------------------------------------------------------------------

Tested on Google.com, Google.ca, Google.co.uk, Google.co.jp
 
#15
According to you, what is the hardest and/or the easiest musical instrument to play.
Now before posting, I don't want to see anything like "the triangle" as the easiest instrument (I want to see some instruments that needs a little bit of skillÃ,  :P)

________________________________________________________________


-According to me the easiest instrument would be, the flute because it's something they teach you in 3rd grade.

-The hardest instrument would have to be the chapman stick.Ã,  Just look at the way it's played and how you're supposed to hit the notes. Not only that, you also need to control of both of your hands.Ã,  Ã,  Ã,  Ã, 
#16
Alright, I looked everywhere, I looked in the manual, I tried so many things and I can't get this thing to work(I'm having lot's of trouble lately  :( )

To prevent people from loading empty game slots, I want it to do so that if you click on the load icon (the icon that turns the GUI visible) and that there's no saved games, I want it to display a message instead.  When I try to create a script, the message gets diplayed even if I have a saved game.

What should I to do,  to make it work?     
#17
I made my own GUI to load and save games.Ã,  I'm having this problem with the load part.Ã,  It works, but it won't restore the most recent slot.Ã,  It tells me that there's no such file when I try to load it.Ã,  All the other slots restore without a problem, and if I make a new save slot, the slot that didn't work before, works, but then the newest one doesn't. What's going on?

This is the script used:

Code: ags

RestoreGameSlot (ExampleList.SelectedIndex);
#18
How can I make a button change appearance when I click on it, and keep it changed until I click on another GUI button.Ã,  The "pushed image" function only changes the appearance of the button while I click on it, and that's not what I want.
#19
I'll just bring a little bit of christmas spirit. What are you looking forward to this christmas ?

Example of things:

-christmas list
-special event
-trip to somewhere
-whatever you are looking forward to

I'm looking forward to spending time with my family *cough*gettingpresents*cough*, yeah, that's right, spending time with my family *cough* *cough*.
#20
What software/program do YOU use to create your own music for adventure games?Ã,  It seems that many people have talent when it comes to music-making, but we never get to know what's the tool behind it.

As for me, I suck at creating that kind of stuff, but I'm currently trying to get along with FL Studio.
SMF spam blocked by CleanTalk