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

#1701
Is this exactly how you have your script? 'Cause (if I'm not completely blind) everything is correct in there.

EDIT: Make sure you have your brackets ({ and }) correctly in those parts that you left out when posting here. It's likely to be a bracket-mistake.
#1702
You are right; there is no way to work around not having infinite characters that works for every game, but in most situations, you can still somehow get around this problem.

When I wrote "Troopers" (realtime-strategy game with AGS), I had the same problem of course. I just decided to limit the maximum number of units a player can have by adding an "energy resource", that all units cost in addition to costing money etc. This seemed perfect, because it would allow you to have a reasonably large amount of units, while at the same time the limit of units wouldn't feel to unnatural because popular games like StarCraft work the same.

In other situations, you could possible use the RawDraw functions and structs/arrays.
#1703
That would be useful - but probably not for normal adventure games. Anyways, you can work around this.
#1704
Yeah, now you have 2 "interface_click" functions in your script. The one that I "gave" you and another old version that was there before, which was written by AGS for the functionality of the standard GUIs.

If you have don't have any default GUIs anymore (and changed them ALL into your new ones), then you can just delete the whole interface_click function starting in line 85 and going to the end (where the }-bracket closes the function).

If you still want to use the default AGS-GUIs and just added your GUI with the button on it, then simply combine the functions. That means that you need to erase the function, that I gave you and copy the content of this function into your older interface_click function in line 85:

Code: ags

function interface_click(int interface, int button) {

// PASTE THE CONTENT FROM OTHER FUNCTION HERE!
if ( interface == MYGUI )
// .........
// END OF PASTED CODE

if (interface == ICONBAR) {
if (button == 4) {  // show inventory
show_inventory_window();


This should be everything.
#1705
Adventure Related Talk & Chat / Re: New Banner
Sat 14/01/2006 14:41:52
Looks very good and changing works smoothly... :D
#1706
(1) Change the "gui" to "interface" (sorry, my mistake).

Code: ags

#sectionstart interface_click  // DO NOT EDIT OR REMOVE THIS LINE
function interface_click ( int gui, int button )
{
   if ( gui == ICONBAR )
   {
      if ( button == 1 )
      // if button 1 was pressed
      {
           // animate player character
           player.Animate(6, 2, eOnce, eBlock );
      }
   }
}


That will fix the error.

(2) Your question:
AGS will use the view, that the character currently has for animating! If you want to be really safe, then add a line before the "player.Animate":

Code: ags

// be safe and set player view first
player.LockView ( 12 );
// animate player character
player.Animate(6, 2, eOnce, eBlock );
// now - after the animation finished playing - unlock the view again
player.UnlockView ();


But you don't NEED the LockView and UnlockView function calls if you have your animation stored in the view with all the walking sprites for your character. They are only needed if you have one view with the character walking and ANOTHER view with all his "special" animations - such as jumping/shooting/pickung sth. up...

Hope this helps!

Make sure to use the [*code] and [*/code] tags without the stars next time when you want to post code - this makes reading it much easier!

EDIT: Ashen's reply was faster, but maybe my reply can still help you!
#1707
You might want to say which programming language it is. It looks exactly like c++ except you end the function definition with a }; ?

If you use c++, you should look into the iostream.h header, which gives you overloaded operators, that work like this:

Code: ags

cout << "This is a test output";
int number;
cin >> number;


That would output the message and then let the user enter a number.
#1708
Quote from: voh on Fri 13/01/2006 13:35:02
Shouldn't a microphone (singing one) work through that setup as well?

Unfortunately not, because of XLR (or phantom power) problems. You'd need a mixer or a mic preamp inbetween. There are also adaptors out there, but those don't sound too good eitehr, I heard.

But your vocals sound really good and professional. It's just the guitars (that I would plug into the pc directly - this can sound pretty decent without spending +200â,¬ for a good mic and even more for pre-amps/mixers) and then add digital drums (use a drumcomputer or your pc).
#1709
Strazer is right, but in the end it doesn't matter HOW you import the sprites. From what you wrote, it seems that you have them all imported correctly and put them in a view.

Don't worry about framerates for now.

Now somewhere in your script you need to "start" that animation (triggering it would be the better name). Let's say you want a GUI button to trigger that animation. So you'd click on "Script" and then on "interface_click". There you need to add something like this:

Code: ags

function interface_click ( int gui, int button )
{
   if ( gui == MYGUI )
   {
      if ( button == 0 )
      // if button 0 was pressed
      {
           // animate player character
           player.Animate(5, 3, eOnce, eBlock );
      }
   }
}


This would animate the player character using loop 5, a framerate of 3, one time and blocking. Remember to replace "MYGUI" with the name of the gui that your button is on and the "button == x" with the number of your button, the loop number (5) with the actual loop number of your animation and of course the speed of the animation (3) with the speed that you thing fits best.
#1710
Unfortunately you can't import a .gif file just like this with AGS.
Just import all of them (preferably by clicking right into the sprite-manager field and choosing "Quick import mutliple sprites...") and then just place them in a view. To change the framerate of the whole animation, you can use a parameter when you call the "animate" function with AGS script, to change the frame rate or duration of ONE frame, you can click on "delay" in the view-manager and change this frames delay.
#1711
Hey that was actually pretty sweet!! :)

The vocals are very good (quality-wise and the quality seems great too).

You just need better recording quality (as Helm said before) for both guitars and drums.

You can always buy an 1/4 inch to mic-jack adaptor for a few dollars and then plug your guitars directly into your pc (I do it this way for now, and I was able to produce tracks like those!
#1712
WMA and MP3 is a completly different file format. AGS supports some and other's not. That's how it is. You can always google for a free WMA-to-MP3 converter though...
#1713
Allright, allright. :D

I suppose you have already imported your "trapbox open" and "trapbox closed" images into the sprite manager!? Open the sprite manager and take a look at those two images: notice the number? Remember this number for the opened and closed image.

Now when the player opens the trapbox, add an interaction and choose "run script". Then click on "edit script" and add this line:

Code: ags

oTrapbox.Graphic = 562;


You need to use AGS 2.7 or greater for this to work. Also replace "562" with the number that you remembered before for the open image. Also make sure that your trapbox object is actually named "trapbox, so that the script-o-name is "oTrapbox"!

Then you do the same for when the player closes the trapbox and add the line of code, just make sure to change the number to the one you remembered for the closed image.

Easy as this. Ask if you have further questions!
#1714
Ah, then you need to use object.Graphic to set the spriteslot number to the opened/closed image of the trapdoor whenever the player opens or closes it!
#1715
I'm afraid, I don't quite understand.

Do you mean, that the "new" trapdoor that you added as object is always visible (wich would mean that the trapdoor always looks opened)?

Then make sure to deselect the "Object is initially visible"-checkbox!
#1716
Use objects. The opened trapdoor can then be made visible when you want it to look opened and invisible when it's closed.

Read the manual for more information on objects, how to create those and how to make them (in-)visible.

And welcome to the forums!
#1717
Ah yes, thanks a bunch. *knocks himslef* not my day today - did I already mention that? :=
#1718
Wait a second, how come that I don't have to export them??

I can just define and import them in the header! I double-checked.
#1719
Are you sure, that you have:

Code: ags

bool PlayerIsOnSkip;


at the top of your global script file (CTRL+G) and:

Code: ags

import bool PlayerIsOnSkip;


in your global header file (CTRL+H)?

This error shouldn't occur if you have both lines in place.

Sorry for being not so helpful, don't know what it is today...
#1720
Argh, sorry for this... I am really tired today.

Move that line again. This time out of the room script file and into the global script file (CTRL+G - (to the top). Then write this to the script header (CTRL + H):

Code: ags

import bool PlayerIsOnSkip;


Solving those problems is really hard when you don't have the game in AGS in front of you.

Hope it works now!
SMF spam blocked by CleanTalk