mixing two objects

Started by Alen101, Sun 22/11/2015 06:16:02

Previous topic - Next topic

Alen101

im mixing two objects with this code:

Code: ags

function iPilas_UseInv()
{
 if (player.ActiveInventory == iPilas)
  {
  player.Say("Doesnt make sense to use this item on itself.");
  }
  
  if (player.ActiveInventory == iCtrlnopilas)
  {

   player.LoseInventory(iCtrlnopilas);
    player.LoseInventory(iPilas);
    player.AddInventory(iCtrluni); 
      player.Say("Ok the control should be functional now.");
      
          if(mouse.Mode != eModeWalkto) //this attempt doesnt work
          {
          mouse.Mode = eModeLookat; 
          }
  }


The problem is when i mixed them, after the player make that action, the two objects leave and the new one appears, but:
1:After that the mouse cursor change to Walkto, no matter what, even if i was on look at mode before


Could i disable the walk to while the player is on the menu?

AnasAbdin

What exactly are you trying to achieve after 'mixing the objects'?  ..cursor wise

Alen101

Well is not a big problem, just that after i mixed the two objects the mouse cursor changes for the walking cursor, and in the menue the walking cursor is not used, so im trying this not to happen.

Slasher

#3
Something like this may help. i believe going back to walkto is default.

This is one way.

After combining inv items return to Lookat:
Code: ags

function on_event(EventType event, int data)  //Locate this function in global and add
{
 if(event == eEventAddInventory && mouse.Mode == eModeWalkto)
 {
  mouse.Mode = eModeLookat;
  mouse.UseModeGraphic(eModeLookat);
 }
}


try it...


Alen101

#4
Sorry guys it was a stupid mistake from my part,

this code is working now:
Code: ags
if(mouse.Mode == eModeWalkto) 
          {
          mouse.Mode = eModeLookat; 
          }


the problem was that i had this: != instead of this ==
really stupid mistake thanks for all the help. and sorry for the stupid question.

SMF spam blocked by CleanTalk