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 - Lt. Smash

#241
Some bugs:
I started AGS, created a new font, double clicked it and this error message came:
Quote
---------------------------
Adventure Game Studio
---------------------------
An unexpected error occurred. Please note down the following information and contact CJ.



System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.

   at drawFontAt(Int32 , Int32 , Int32 , Int32 )

   at AGS.Native.NativeMethods.DrawFont(Int32 hDC, Int32 x, Int32 y, Int32 fontNum)

   at AGS.Editor.FontEditor.imagePanel_Paint(Object sender, PaintEventArgs e)

   at System.Windows.Forms.Control.OnPaint(PaintEventArgs e)

   at System.Windows.Forms.Control.PaintWithErrorHandling(PaintEventArgs e, Int16 layer, Boolean disposeEventArgs)

   at System.Windows.Forms.Control.WmPaint(Message& m)

   at System.Windows.Forms.Control.WndProc(Message& m)

   at System.Windows.Forms.ScrollableControl.WndProc(Message& m)

   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)

   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)

   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
---------------------------
OK   
---------------------------

And:
When I open the sprites window or other window and click on something else in the upper right field, the settings field to the right disappears. -> it gets white.
#242
look here:

http://www.adventuregamestudio.co.uk/yabb/index.php?topic=26978.0

I think that answers your question.

EDIT:
If you want a button for restarting, first create a button.
Name it. (example: btnRestart)
Doubleclick it.
And in the function(btnRestart_Click)
call RestartGame()

It should work if you use Gilbot V7000a's code.
#243
I only wanted to ask you, if you had enough time of making an example and if you could post it, please?

I think the problem is in the getPlate() function but I could be wrong.
#244
Thanks for the quick answer!

Quote
QuoteAdd a new parameter to the IsKeyPressed function(IsKeyPressed(int keycode, optional RepeatStyle) or make a new function(IsKeyDown(int keycode)).
RepeatStyle lets you set that the whole script after IsKeyPressed will be either run once or always(repeat).
I'm quite sure this can be done with scripting.

I think it would be better if it's included because there are some times where it's very hard to code.(and sometimes where it's almost impossible)
I have a fight engine and when I press the 9 key(numeric pad) he should only punch one time and not always. Maybe you know how to rewrite the script. I use this: http://www.lumpcity.co.uk/~skimbleshanks/misc/BoxScript.rtf

But I think it would be better if the function is included.
#245
Advanced Technical Forum / Some SUGGESTIONS
Mon 05/03/2007 14:37:28
I've listed some suggestions, which I will probably need in my adventure:


  • Allow to change the dialog options color.
    EXAMPLE: Player speech color is white, dialog options color is brown.

  • Add codes for "+", "-", ".", "," to the ASCII code table.

  • Add a new parameter to the IsKeyPressed function(IsKeyPressed(int keycode, optional RepeatStyle) or make a new function(IsKeyDown(int keycode)).
    RepeatStyle lets you set that the whole script after IsKeyPressed will be either run once or always(repeat).
    EXAMPLE: You want the char to jump up only once when you press "space". It doesn't change anything if you hold down the "space" key because IsKeyPressed is turned to eOnce. So he only jumps once.

  • Add a function to set a key which skips the speech of the character which is currently talking.
    EXAMPLE: Player1 says:"Hi, my name is nobody and I'm somebody." While he is talking and the player presses the "." key, he stops talking and player2 will talk.


Hope that some of these could be implemented in a newer version of ags.
#246
KhrisMUC could you post a working code for the plates room, please?
It would be very useful because the code you first post doesn't really work.
#247
That works fine!

But the other code with the dummy doesn't work.
#248
Quotetxt.WriteRawLine("  plate[%d].hs=%d;", i, hs.ID);
txt.WriteRawLine("  plate[%d].re=%d;", i, re.ID);
txt.WriteRawLine("  plate[%d].x=%d;", i, x);
txt.WriteRawLine("  plate[%d].y=%d;", i, y);

That doesn't work because WriteRawLine doesn't support variables(I think so).

Could you make a demogame or a template where the whole plates thing work?
#249
When I insert Return; after "CallRoomScript(1);" the character doesn't move. Only the dummy.

When I move the mouse over a plate and press 'D' the char always says  0.

Could you write an example of how you set up a plate?
#250
QuoteI'd comment out this line:

cDummy.Transparency=100;


and check what Dummy does after clicking.

I've done that. The dummy walks to the plate I've clicked but he doesn't stop on the plate between. When he stops the character walks to the starting point and then he walks to the plate where the dummy stands.(crossing some other plates)
But sometimes the dummy stops on a plate between the plate I've clicked but the character walks to the plate I've clicked.
Sometimes also the other way round -> dummy walks to plate character stops somewhere between.

QuoteWait, you did set .x and .y of all the plates, right?

Yes, I did that.

QuoteAnd you prevented ProcessClick from still getting called in on_mouse_click, right?

I'm not quite sure, because I use the FOA template.

The code is:
Code: ags
//	Handling room clicks:
//-----------------------------------------------------
 else if (button==LEFT || button==RIGHT) {
    
    if (button==RIGHT) SetMode(GetDefaultAction(mouse.x,mouse.y));// set the default mode when right click
    
    if (button == LEFT && GetMode()==WALK && player.Room==4)// plates room on_call
		   {
			  CallRoomScript(1);
		   }
		 
    if (Extension(GSlocname)==EXITS_EXTENSION){// if its an 'exit'
        HighlightActionBar();
        WalkOffScreen(); 
    }
    else if (ALWAYS_GO_TO_HOTSPOTS==1 && ExtensionEx(2,GSlocname)!='d' && GetLocationType(mouse.x,mouse.y)!=0 ){
       UpdateActionBar(mrx,mry);
       HighlightActionBar();
       if (Go()==1)   ProcessAction(GetMode(),mrx,mry);
       return;
    }
    
    else ProcessAction(GetMode(),mrx,mry);
  }
//-----------------------------------------------------


Hope you can help me.

EDIT:

where exactly must I set up the plates?
#251
When I click on a plate the character always moves to his starting position(room entering position) and then he walks to the plate.

Do you know how I can fix that?
#252
Advanced Technical Forum / Room with plates
Fri 23/02/2007 10:32:54
hi,

I have drawn a room with plates, similar to the second challenge in 'Indiana and the Last Crusade'.

Here's a bit of my plates map:




So my questions now are:

How can I check, if the character is now on the upper left plate or on the 1st plate in the 3rd line?(without using hotspots, regions, etc. because there are more than 50 plates!)

And is it possible to make the character jump(walk) only to one plate at once?

Example: If he's on the first plate(second line) and the player clicks on a plate far away(upper right) he doesn't walk or he only walks to the next plate(which is in the right direction) and than stops.

If it's possible, how?

Hope that someone can help me,

Lt. Smash
#253
only a question:

monkey are you going to make a character for the flashlight as GarageGothic suggested or have you found a simplier solution for that Alpha blended problem?
#254
Advanced Technical Forum / Re: Script Problem
Mon 19/02/2007 19:23:11
function repeatedly_execute() {
  String buffer;
  String madetext;
  int cur_mode;
  int useorgive;
  madetext.Copy();
  cur_mode = mouse.Mode;
  if (cur_mode == MODE_WALK)
    madetext.Append("Gehe zu ");
  else if (cur_mode == MODE_LOOK)
    madetext.Append("Schau an ");
  else if ((cur_mode == MODE_USE) && (GetGlobalInt(1)==1))
    madetext.Append("Benutze ");
  else if ((cur_mode == MODE_USE) && (GetGlobalInt(1)==0))
    madetext.Append("Gib ");
  else if (cur_mode == MODE_TALK)
    madetext.Append("Rede mit ");
  else if (cur_mode == 5)
    madetext.Append("Nimm ");
  else if ((cur_mode == 4) && (GetGlobalInt(1)==1))
    {
    madetext.Append("Benutze ");
    buffer = player.ActiveInventory.Name;
    madetext.Append(buffer);
    madetext.Append(" mit ");
    }
  else if ((cur_mode == 4) && (GetGlobalInt(1)==0))
    {
    madetext.Append("Gib ");
    buffer = player.ActiveInventory.Name;
    madetext.Append(buffer);
    madetext.Append(" an ");
    }

  else if (cur_mode == Cool) {
    if (GetGlobalInt(80) == 1) madetext.Append("SchlieàŸe ");
    if (GetGlobalInt(80) == 2) madetext.Append("Gib ");
    if (GetGlobalInt(80) == 3) madetext.Append("Öffne ");
    if (GetGlobalInt(80) == 4) madetext.Append("Drücke ");
    if (GetGlobalInt(80) == 5) madetext.Append("Ziehe ");
    }

  // Find out what's under the cursor, and add it to the status line
  buffer = Game.GetLocationName(mouse.x,mouse.y);
  madetext.Append(buffer);
  SetLabelText ( 0, 12, madetext);
  }

I think that should help ;)
#255
I heard that MarvinS also made a foa-style fight-system but I can't find it anywhere.

Does someone know where I can find it?
#256
Oh yes I forgot that. sorry
#257
I wouldn't bother if I have to use a GUI AND a character.

But wouldn't the whole thing work with RawDraw?
#258
It would be a bit of work, but if you use a second gui with no transparency as the flashlight gui(the other one as the background gui), it would probably be possible to use alpha transparency and the transparent background at the same time. Or am I wrong?
#259
QuoteAs for the PNG, as long as you can import it into AGS then you can use it. Import the sprite into the Sprite Manager, then do something like this:

Code:
// game_start
Flashlight.SetSprite(DynamicSprite.CreateFromExistingSprite(42)); // 42 would be the slot number for your sprite

that don't work.

I think the problem is, that currently only bmp and pcx can be loaded as a dynamic sprite.
So it would be better if the sprite will be used as the buttons normal graphic and not as a dynamic sprite.

Then it would be possible to use every format(if its supported from the editor) and it would be possible to use an already transparent picture.

EDIT:

using Flashlight.Sprite.Delete(); only the flashlightsprite will be deleted but there are also 5 other dynamic sprites, which won't be deleted.
#260
when using the new 2.0 beta i get an error message:

ERROR (line 12): 'Follow Character' is already defined  //in Flashlight header

I hope you can fix it.

question:
is it possible to use an png as the flashlight, which is already transparent(alpha blended sprite) and has a black transparent  gradient?

like this?
SMF spam blocked by CleanTalk