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

#441
Hey Monkey!

Ok, well that was one of the workarounds I tried, is there any way I can do it so I dont have to put code in each room script?

For example, this is what I did for a custom global script to be run in each room and I did it all from the global script...any way to get this to run with everything from the global script  (and not have to add anything in the room scripts)?

Code: ags

//on_event (EventType event, int data)
  if (event == eEventEnterRoomBeforeFadein)
  {    
       enterDir(player);
       if (bFollow == true) enterDir(cBuddy);
  }


The reason I would like a global eEventEnterRoomAfterFadein is because Ive written a script that detects which exit was used from a previous room (left, right, up or down), and upon entering "x" room, it checks the saved variable and runs the appropriate blocking animation of the player entering that room "x" to a specific spot...this saves me time.

Adding a new global event...is this something only CJ can do?
#442
Im aware of various work-arounds with variables and rep_exec, but if this can be avoided, that would be great.

I cant seem to find a global event for 'Player enters room after fadein'  (I just see eEventEnterRoomBeforeFadein)...does it exist in another form (or way to do it hidden in the manual somewhere?)

If this doesn't exist, how come? And...is there a way I can add "custom" global events? Id really like to avoid having to add the same lines into each room's AfterFadeIn.
#443
Khris = genius.

Thanks again, this works awesome!!  :)
#444
Hi,

Ive got a question on if this is a good way to start for the following idea:

Id like to do something similar to the function "faceCharacter", as in I want to query the target and source characters' x,y coordinates, do a substraction on them, and depending on the results assign a string (or integer) to that result...its so that depending on where the target character is in relation to the source character, the source character will animate a certain "turning" animation before heading towards the target (Ive got lots of transition turn animation loops and I need to know which one to call depeding on the 2 characters' positions).

Lets say the source character I want to do the turning (to face another character) is "this"...and the "target" character I want "this" to face is the cChar:

Pseudo Code:
Code: ags

void TurnCharacterTowards(this Character*, Character *cChar)
{
  //get coordinates of cChar (b)
  int bX = cChar.x;
  int bY = cChar.y;

  //get current char coordinates (a)
  int aX = this.x;
  int aY = this.y;  

  //Substraction: cChar - current
  int cX = bX - aX;
  int cY = bY - aY;
  //depending on result, put loop number value...
  if (cX is only inside this boundary) int iLoop = 0;
  else if (cX is only inside this boundary) int iLoop = 1;
  etc...
}


The only thing is Im not sure if Im approaching this the right way. Also, Im not too sure how to get the boundaries I need. Look at this pic I did below:



Assume "this" is in the middle of the grid. If the "target" character (cChar) is inside the red boundary, for example, how do I write it so I can get "if cChar is in this boundary, cChar is to the left of "this", run loop 1".

I have a tendency to make life hard for myself so what do you guys think? Is there an easier way?
#445
Count me as one person interested in that plugin :)
#446
Ill take a look in your UtilityModule 0.1 to see if I can extract what I need...thanks for the heads up!

**EDIT**

Id like the mouse to follow this path (lemniscate path):
http://curvebank.calstatela.edu/lemniscate/lemniscate.htm#
http://mathworld.wolfram.com/Lemniscate.html
#447
Hi!

Ive got a weird one...right now Im using the following script to make the mouse cursor move/jitter randomly around:

Code: ags

void mouseDrunk(int iPixelsInitial, int iCounterInitial)
{
  iPixels = iPixelsInitial;
  iCounter = iCounterInitial;
  int iRand_a = Random(iPixels);
  int iRand_b = Random (1); //pos or neg
  int iCurrentPosX = (mouse.x);
  int iCurrentPosY = (mouse.y);
  int iDrunkPosX;
  int iDrunkPosY;
  if (drunkMouseCounter >= iCounter) //every 5 game loops
  {
    //substract random num
    //DisplayACL("%d", iRand_b);
    if (iRand_b == 0)
    {
      iDrunkPosX = (iCurrentPosX + iRand_a);
      iDrunkPosY = (iCurrentPosY + iRand_a);
    }
    else if (iRand_b == 1)
    {
      iDrunkPosX = (iCurrentPosX - iRand_a);
      iDrunkPosY = (iCurrentPosY - iRand_a);      
    }
    drunkMouseCounter = 0;
    mouse.SetPosition(iDrunkPosX, iDrunkPosY);
  }
  else drunkMouseCounter++;
}


The result is pretty good, but it seems too "linear", not "swooshy" enough. Do any of you geniuses know how I could have the mouse cursor follow an infinity symbol (horizontal figure-8), clock-wise and counter-clockwise? The cursor would move along this path randomly, but not too much so its choppy/jumps and also so that the infinity symbol is kinda evident (but not too much, ehehe)...more of a smooth swooshing with slight random jitter...

This is too tough for me!
#448
Will there be some sort of version that will "combine" various other people's features into this one as a single-major updated version? Seems to be a few versions out now by various peeps, it would be cool to get all those together in one!
#449
The main thing about this game that made me want to download it is the graphics! I love this cartoony style, very clean...Im playing it now :)

ps: Dont need to hire someone for graphics, continue in the same fashion.
#450
Man after (serious) a few days debugging, I solved it!

I needed to add this in my rep_exec:

Code: ags

      else if (overGuiControl == lstRadioCode)
      {
        if (iExecuteDC == 1)
        {
          if (bReady == true)
          {
            btnRadio_Send_OnClick(btnRadio_Send, eMouseLeft);
            iExecuteDC = 0;
            bReady = false;
            return;
          }
        }
        else if (iExecuteDC == 0)
        {
          if (bReady == true)
          {
            //btnRadio_Send_OnClick(btnRadio_Send, eMouseLeft);
            iExecuteDC = 0;
            bReady = false;
            return;
          }          
        }


Maybe this post will help someone with a similar prob :P
#451
Hi,

This one is truly pissing me off! I really dont know why this is giving me weird results:

Ive got a GUI with a listbox that when you double click on an item, it executes a script (you send a radio message). Everything works fine if I dont select an item in that list first, pause, then double click...it works properly only if I use the double-click on the items within the list.

Example-->


Lets say I double-click on "Code-10", cool, it works...the main player radio's dispatch Code-10...BUT, if I select, say, "Code-9" with single click first, then double-click on "Code-10", Code-9 will be sent since there isnt enough time to switch the text to Code-10 (Im guessing?)

Here are the scripts Im using...Im not sure why its not behaving properly.
Code: ags

void doubleClick(eDoubleClickSpeed eSpeed)
{
  ViewFrame *frame0 = Game.GetViewFrame(VWAIT_FAKE, 0, 0);
  if (frame0.Graphic != 2061) frame0.Graphic = 2061;
  mouse.ChangeModeView(eModeWait, 54); //fake "Pointer-Wait" view...(waitMouseKey shows Wait View)
  mouse.ChangeModeGraphic(eModeWait, 2061);
  
  int iDoubleClick;
  int dc;
  if (eSpeed == eSlowClick) dc = 15;
  else if (eSpeed == eMediumClick) dc = 12;
  else if (eSpeed == eFastClick) dc = 9;
  
  iDoubleClick = (WaitMouseKey(dc) * mouse.IsButtonDown(eMouseLeft));
  if (iDoubleClick)
  {
    mouse.ChangeModeView(eModeWait, 14); //restore Default Wait view
    mouse.ChangeModeGraphic(eModeWait, 297);    
    //DisplayACL("Double click!");
    iExecuteDC = 1;
  }
  else iExecuteDC = 0; 
}


Code: ags

void on_event (EventType event, int data)
{ 
  overGuiControl = GUIControl.GetAtScreenXY(mouse.x, mouse.y);
  if (event == eEventGUIMouseDown && overGuiControl == lstRadioCode) doubleClick(eMediumClick);
}

Code: ags

//in rep_Exec
  ...else if (gRadio.Visible)
  { 
    if (overGuiControl == null || lstRadioCode.SelectedIndex == -1)
    {
      if (sldRadio_Channel.HandleGraphic != 1433) sldRadio_Channel.HandleGraphic = 1433; //reset
      else if (sldRadio_Frequency.HandleGraphic != 1421) sldRadio_Frequency.HandleGraphic = 1421; //reset
      clearLBL(lblRadioHotspot);
    }
    else 
    {  
      if (overGuiControl == lstRadioCode)
      {
        if (iExecuteDC == 1)
        {
          if (bReady == true)
          {
            btnRadio_Send_OnClick(btnRadio_Send, eMouseLeft);
            iExecuteDC = 0;
            bReady = false;
            return;
          }
        }
      } 


Code: ags

function lstRadioCode_OnSelectionChange(GUIControl *control)
{
  clearTXT(txtRadio_CodeInput); //first clear whats in the LCD
  String selectedItemText = lstRadioCode.Items[lstRadioCode.SelectedIndex];
  txtRadio_CodeInput.Text = selectedItemText;
  bReady = true;
}

I think it has something to do with iExecuteDC = 0 (if double-click is false)...cause thats when it seems it screws things up.
#452
Quote from: monkey_05_06 on Tue 02/11/2010 17:22:02
It should already be saving layout changes..I thought..

Well so far, doesnt seem like it for me! Everytime I reload AGS, I have to manually resize my panels how I like them (you know, the little arrow that pops up when you are over panel "seams")...
#453
Do you think this can be added?

Have a feature that saves your editor layout so you can load it later...right now if I resize panels (like the width of the folder display list for the sprites, for example)...it doesnt save the resize when I restart the AGS editor...pretty annoying to have to resize this all the time!
#454
Thirded... ;D

Downloading now, nice!!
#455
Works on my win7 cpu, doesnt work on my xp laptop (like monkey)
#456
Copying the gui's + controls is an excellent idea! I would suggest perhaps giving more control on the folders, like being able to drag folders over each other to change their order, or class them alphabetically, etc...more like in windows.

Here are some more suggestions if you think some of them are good ideas:

-Being able to create or class dialogs + inventory items + gui's + characters into folders

-Having a prompt pop-up when deleting a loop inside a view to ask the user if they are sure they want to delete the last loop...right now if you click on the button by accident, you`re screwed...!

-Adding "undo" to certain actions like deleting controls, gui's, etc...I think Undo is missing in AGS, if Im not mistaken (?)

-Adding bookmarks to sprite folders (with keyboard shortcuts for quick access), and  bookmarks to the script editor (like in UltraEdit).

-Keyboard shortcuts feature (that can be modified by the user)

Ill think of more when Im actually working in AGS and post here frequently if you dont mind... ;D
#457
Well lets say I comment out the SetRestartPoint, shouldn't "Restart" restart the game from start_game in the global script...? Where does the game "start" after "Restart" is called, exactly? Everything after start_game? Im confused! :P

(I thought I would see "Debug Restart" message upon restarting the game, even with SetRestartPoint commented out)

*try saying that post 5 times fast*
#458
I placed "SetRestartPoint()" in my game_start because Im having trouble with loading certain versions of my main character (I have a script that changes the age of the character).

To debug, I wrote this expecting to see "Debug Restart" displayed at the start of  the game. This happens on the 1st time, but if I press "restart", the next time the game loads, I dont see that message...meaning that game_start doesnt get passed after "Restart"?

So right now when I load the 1st time, my character appears in the right room with the right views, etc...but when I press restart, if the game doesnt pass "start_game", then my whole character swap script wont work...

Code: ags

function game_start()
{
  SetRestartPoint();
  Display("Debug Restart");
  Debug(4, 1);
  InitializeInterface();
  ...etc

#459
Quote from: GarageGothic on Tue 26/10/2010 00:22:08
Quote from: icey games on Mon 25/10/2010 23:44:03Is ags smart enough ...

AGS is smart enough to know that nobody else in the world gives a shit about which inventory item you picked up, or whether you just clicked a cow.

hehehe...
#460
For Khris's module, it really does a nice job of scaling sprites with bilinear filter, but if you're going to do it "live" constantly, I think it might be a bit sluggish...but thats only for tests Ive done in 1024x768, so if you have smaller sprites/smaller res game, perhaps it will be faster...
SMF spam blocked by CleanTalk