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 - 10o

#1
My GUI ist still like in this Thread :
http://www.adventuregamestudio.co.uk/yabb/index.php?topic=44644.msg596325#msg596325

Problem is that I can rightclick on the Items and it will wie displayed the current Message, but if I rightclick on them my Curser stays the same and doesent get the Iventory object. So I'am not able to drag out the Objects from the Inventar.

I found some kind of Help on Adventure Treff from a Thread and added following lines:


In repeatedly_execute:

Code: ags

  GUIControl*gc = GUIControl.GetAtScreenXY(mouse.x, mouse.y);
  if (gc == invCustomInv) {   // Maus über Inventarfenster?
    if (mouse.Mode != eModeInteract && mouse.Mode != eModeUseinv)
      mouse.Mode = eModeInteract;
  }


Inventar-Klicks:
Code: ags

// Anfang von on_mouse_click:

  InventoryItem*ia = inventory[game.inv_activated];  // falls Klick auf Inv Item, in ia speichern

  // dann:
  ...
  else if (button == eMouseLeftInv) {
    if (mouse.Mode == eModeUseinv) ia.RunInteraction(eModeUseinv);  // aktuelles Item mit ia benutzen
    else player.ActiveInventory = ia;  // angeklicktes Item auswählen
  }
  else if (button == eModeRightInv) {
    if (mouse.Mode == eModeUseinv) player.ActiveInventory = null;  // aktives Item abwählen
    else ia.RunInteraction(eModeLookat);  // angeklicktes Item anschauen
  }



But it didn't do anything.



Here my aktulized skript wich still doesent work out for that problem:
Code: ags

function on_mouse_click(MouseButton button) {
   
  InventoryItem*ia = inventory[game.inv_activated];  // falls Klick auf Inv Item, in ia speichern

  // called when a mouse button is clicked. button is either LEFT or RIGHT
  if (IsGamePaused() == 1) {
    // Game is paused, so do nothing (ie. don't allow mouse click)
  }
  else if (button == eMouseLeft) 
  {
 //   ProcessClick(mouse.x, mouse.y, mouse.Mode );
        int nm;
    if (GetLocationType(mouse.x, mouse.y) == eLocationCharacter)
    {
      nm= eModeTalkto;
    }
    else if (GetLocationType(mouse.x, mouse.y) == eLocationNothing)
    {
      nm= eModeWalkto;
    }
    else if (GetLocationType(mouse.x, mouse.y) == eLocationHotspot)
    {
      if(wechsel == 0)
      {
      nm=eModeInteract;
      }
      else
      {
      nm= eModeWalkto;
      }
    }
    
    else
    {
      nm=eModeInteract;
    }
    ProcessClick(mouse.x, mouse.y, nm);  
  }
  else if (button == eMouseRight || button == eMouseWheelSouth){
    // right-click our mouse-wheel down, so cycle cursor
   // mouse.SelectNextMode();
   int mm;
    if (GetLocationType(mouse.x, mouse.y) == eLocationNothing)
    {
      mm = eModeWalkto;
    }
    else
    {
      mm = eModeLookat;
    }
    ProcessClick(mouse.x, mouse.y, mm);

  }
  else if (button == eMouseMiddle) { 
    // Middle-button-click, default make character walk to clicked area (a little shortcut)
    // Could have been just "player.Walk(mouse.x,mouse.y)", but it's best to
    // leave our options open - what if you have a special script triggered
    // on "walking" mode?
    ProcessClick(mouse.x, mouse.y, eModeWalkto); 
  }
  else if (button == eMouseWheelNorth) { 
    // Mouse-wheel up, cycle cursors 
    // If mode isn't WALK, set the previous mode (notice usage of numbers instead
    // of eNums, when it suits us)...
    if (mouse.Mode>0) mouse.Mode=mouse.Mode-1; 
    else 
    { 
      // ...but if it is WALK mode...
      if (player.ActiveInventory!=null) 
      {
        //...and the player has a selected inventory item, set mouse mode to UseInv. 
        mouse.Mode=eModeUseinv; 
      }
      else 
      {
        // If they don't, however, just set it to mode TALK (change this line if you add more cursor modes)
        mouse.Mode=eModeTalkto; 
      }
    }
  }
  else if (button == eMouseLeftInv) 
  {
    if (mouse.Mode == eModeUseinv) ia.RunInteraction(eModeUseinv);  // aktuelles Item mit ia benutzen
    else player.ActiveInventory = ia;  // angeklicktes Item auswählen
  }
  else if (button == eMouseRightInv) 
  {
    if (mouse.Mode == eModeUseinv) player.ActiveInventory = null;  // aktives Item abwählen
    else ia.RunInteraction(eModeLookat);  // angeklicktes Item anschauen
  }
   
}

Code: ags

function repeatedly_execute() {
  
  // Put here anything you want to happen every game cycle, even when
  // the game is paused. This will not run when the game is blocked
  // inside a command like a blocking Walk()
  
    GUIControl*gc = GUIControl.GetAtScreenXY(mouse.x, mouse.y);
    if (gc == invCustomInv) 
    {   // Maus über Inventarfenster?
      if (mouse.Mode != eModeInteract && mouse.Mode != eModeUseinv)
      mouse.Mode = eModeInteract;
    }
  
   if (GetLocationType(mouse.x, mouse.y)==eLocationCharacter)
   {
    mouse.Mode = eModeTalkto;
    wechsel = 0; 
    }
  else if (GetLocationType(mouse.x, mouse.y)==eLocationObject)
   {
    mouse.Mode = eModeInteract;
    wechsel = 0; 
   }
    else if (GetLocationType(mouse.x, mouse.y)==eLocationHotspot)
   {
     if(wechsel==0)
     {
      mouse.Mode = eModeInteract;
      wechsel = 0; 
     }
     else
     {
       mouse.Mode = eModeArrowR;
       
     }
   }  
  else 
  {
    mouse.Mode = eModeWalkto;
    wechsel = 0; 
    
  }
  
  if (IsGamePaused() == 1) return;

  // Put here anything you want to happen every game cycle, but not
  // when the game is paused.
}



#2
Yes I've used the Search Engine and only found this (outdated) Thread:
http://www.adventuregamestudio.co.uk/yabb/index.php?topic=25762.0


Since there isn't a normal solution in AGS fot that yet I've tried something.

I use a GUI with Leftclick Walk/Talk/Interact , Rightclick Walk/Look.

The Curser changes to the wanted Symbol, that problem is solved to.

I've managed it this way:
Code: ags

function repeatedly_execute() {

  
 if (GetLocationType(mouse.x, mouse.y)==eLocationCharacter)
   {
    mouse.Mode = eModeTalkto;
    }
 else if (GetLocationType(mouse.x, mouse.y)==eLocationObject)
   {
    mouse.Mode = eModeInteract;
   }
 else if (GetLocationType(mouse.x, mouse.y)==eLocationHotspot)
   {
    mouse.Mode = eModeInteract;
   }  
 else 
  {
    mouse.Mode = eModeWalkto;
  }
  
  if (IsGamePaused() == 1) return;

}


I've added a new Curser called eModeArrowR and placed a Hotspot (called hAusgangR) in the Edge Area where the player changes rooms.

I've added this to my room script:
Code: ags

function hAusgangR_MouseMove()
{

   mouse.Mode = eModeArrowR;

}


It kind of "works", when I get the curso over the hostspot it changes short to the Arrow Cursor but fast back to the Interact Cursor.

As far as I understand it, it gets directly overwritten of the function repeatedly_execute(), so my Question is:

Is it possible to stop this function as long as my Curser is on this special area?
Or maybe another way to solve this problem?





#3
Hi,
I wanted to make a simple Guy where I can Walk and Look on the feft Mousebutton and Interact and talk on the right Mousebutton.
But that ain't the problem, it allready works.

My Problem is, that the Curser stays the same wenn I move over a Character/HotSpot/Object.
How do I change the appereance of the Curser while doing a Mouseover over the Character/HotSpot/Object?
#4
When I enter the room where a NPC is doing an constantly repated Animation I'am not able to move my Player.


function room_AfterFadeIn()
{
 cTyp.Animate(2, 1, eRepeat);
}


What possiblitys do I have to animate the NPC while moving my player?
SMF spam blocked by CleanTalk