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

#1
Advanced Technical Forum / Re: Character.Walk
Sun 07/10/2007 19:22:19
it doesnt work - its still blocking  ??? ???
#2
ah, great! thx
still hanging with this NoBlock stuff *grml*
#3
Advanced Technical Forum / Re: Character.Walk
Sun 07/10/2007 15:07:54
Hm i tried:

function on_mouse_click(MouseButton button) // 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)
    {
    if (mouse.Mode == 0)
               {
          ProcessClick(mouse.x, mouse.y, mouse.Mode);
          mouse.Mode = 0;
          }
    else  {
          NoBlock.Do(mouse.Mode, eLocationHotspot, NoBlock.GetHotXY(mouse.x, mouse.y));
          }
    }
}

But it doesn't work - did i misunderstood something?
#4
Advanced Technical Forum / Re: Character.Walk
Sun 07/10/2007 14:49:41
hey!

Thanks a lot! Thats what i was looking for.

Now all i have to do is to understand how this works. my english is not the best  ;D
#5
Advanced Technical Forum / Character.Walk
Sun 07/10/2007 13:36:27
Hi!

I have a problem using Character.Walk.
What i want is (Lucas-Style), that my character automatically walks to where i clicked. And when he arrived his destination, then he for example says something.

I tried the following:

function on_mouse_click(MouseButton button) // 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)
    {
    character[MARTY].Walk(mouse.x, mouse.y, eBlock);
    ProcessClick(mouse.x,mouse.y, mouse.Mode);
    mouse.Mode = 0;
    }
}

That works, but in the time he walks i'm unable to give him/her a new command.
There is a option with "eNoBlock" - i thought that would help me - but when i use eNoBlock he doesnt walk anymore.

What did i wrong?

Thanks for your help :-)
#6
Thanks!

I used Ashen's method.

I dont want to open a new topic for that:

I have a gui button named "Gib" = "give".
If i have an inventory item and try to give it to someone, i still can give it to the item itsself.
for example: "Give hammer to hammer".
I tried to it with "if.... && GetLocationType(mousex,mousey) != eLocationNothing" but that includes the gui too, which destroy my code (see manual : eLocationNothing = nothing, GUI or inventory).

Any idea how to solve that? Is there a command which can give me out, if i'm on an inv. item or not?

#7
Hm...
It doesn't work in my code.

My GUI does:

if (button == 5) {       // Schliesse
  mouse.Mode = 10;
}

And my code is now:

function unhandled_event (int what, int type)
{
    if (what == 1)
    {
    if (mouse.Mode==10) Display("Das kann ich nicht schliessen.");
    else {
             if (type == 1) Display("Ich sehe nichts Besonderes.");
             else if (type == 2) Display("Das kann ich nicht benutzen.");
             else if (type == 3) Display("Das funktioniert so nicht.");
             else if (type == 4) Display("Es antwortet nicht.");
             else if (type == 7) Display("Ich kann das nicht nehmen.");
             else if (type == 8) Display("Ich kann das nicht bewegen.");
             else if (type == 9) Display("Das kann ich nicht öffnen.");
         }
    }
}

any idea?
#8
oh okay, a simple if/else works here?

i thought this function_unhandled only accepts this what/type stuff.

i like ags more and more :)
thank u
#9
Hi !

I could not find a workaround for following problem:
Here a part of my code:

function unhandled_event (int what, int type)
{
 
  if (what == 1)
    {
    if (type == 1) Display("Ich sehe nichts Besonderes.");
    else if (type == 2) Display("Das kann ich nicht benutzen.");
    else if (type == 3) Display("Das funktioniert so nicht.");
    else if (type == 4) Display("Es antwortet nicht.");
    else if (type == 7) Display("Ich kann das nicht nehmen.");
    else if (type == 8) Display("Ich kann das nicht bewegen.");
    else if (type == 9) Display("Das kann ich nicht oeffnen.");
    }
}

Now i want to add a message like this for my cursor 10.
But the manual says:

WHAT TYPE Description
1    1   Look at hotspot
1    2   Interact with hotspot
1    3   Use inventory on hotspot
1    4   Talk to hotspot
1    7   Pick up hotspot
1    8   Cursor Mode 8 on hotspot
1    9   Cursor Mode 9 on hotspot

a "Cursor Mode 10 on hotspot" cant be supported?
i tried if type = 10, but that didnt work.
Does anyone have an idea!?

thanks for the help!

Patrick
#10
Hey !

Thanks for the fast help!

it works for me now and i finally understood this "null pointer" mistake  :-*

here the code:

function repeatedly_execute()
  {
   
  String  console, buffer;
  int cur_mode = mouse.Mode;
 
  if (cur_mode == 0) console ="Gehe zu ";
  else if (cur_mode == 1) console ="Schau an ";
  else if (cur_mode == 2) console = "Gib ";
  else if ((cur_mode == 4) && (cMarty.ActiveInventory != null) && (cMarty.ActiveInventory.Name != null))
    {
    console = "Gib ";
    console = console.Append(cMarty.ActiveInventory.Name);
    console = console.Append(" an ");
    }
 
  if (Game.GetLocationName(mouse.x, mouse.y) != "")
  buffer = Game.GetLocationName(mouse.x, mouse.y);
   else
  buffer = "";
 
  console = console.Append(buffer);
  SetLabelText (0, 0, console);
   
  }

Now i have to solve the problem, that the character can't give an inventory item to the item itself ;-)
But i will check out the manual - i have to learn this stuff.
btw: is there a translation of the manual on german?

Patrick
#11
hi ppl!

I need help. I checked the Manual, but i could not find the reason for the error message:
"Null pointer referenced" "run_text_script1:error -6 running function repeatedly_execute"
here my script:

function repeatedly_execute()
  {
  string console, buffer;
  int cur_mode,  mode;
  mode = GetGlobalInt(299);
  cur_mode = GetCursorMode();
  StrCopy (console, "");
 
  if (cur_mode == 0) StrCat(console,"Gehe zu ");
  else if (cur_mode == 1) StrCat (console, "Schau an ");
  else if (cur_mode == 2 && cMarty.ActiveInventory.Name != null) {
    StrCat(console, "Gib ");
    StrCat(console, cMarty.ActiveInventory.Name);
    StrCat(console, " an ");
  }


  GetLocationName(mouse.x, mouse.y, buffer);
   StrCat(console, buffer);
   SetLabelText (0, 0, console);
   
    }

The error appears, when i click on button 2.

I'm a newbie. Plz dont be too hard to me ;)
SMF spam blocked by CleanTalk