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

#21
Quote from: Cisco on Tue 02/03/2004 23:15:15
where and what, i have to write in the script for
"give the beer to Cisco" and then run a dialog or another script?
in the 'use inventory item on character' interaction, and you should check if the mode used was 'give', something like:
Code: ags

function character_x(){
//use inv on character
if (UsedMode("give")){//if mode was 'give'
  if (character[GetPlayerCharacter()].activeinv==X){ //if beer was used (X -> beer item number)
    LoseInventory(X); // lose the beer
    RunDialog(5);// start dialog #5
  }
}
}
#22
yes, its because the actions that are able to be cancelled with a mouse click. they dont work properly with hotspots that have a walk to point set.
Dont use them, and it should be ok, just like ags default.
kinoko, with the template, there is a doc file, read it, because i think there are answers to some of the questions you have been posting lately : ) (if you can understand my english ;) )

about the 'look at' problem, i dont know, cos several people have reported that, but it always works fine for me  ???
#23
did you export the gui from the template and imported it into your game? or deleted something? you need the functions that come with the template for it to work.
#24
in the 'GoTo' function, look for this line:
/**/  if (locationtype==2) arrived = GoToCharacter(GetCharacterAt(mouse.x,mouse.y),0,1,blocking);
and change it to
/**/  if (locationtype==2) arrived = GoToCharacter(GetCharacterAt(mouse.x,mouse.y),0,0,blocking);
and see if it works
#26
ah yes, there is a bug in those templates that causes what you say, a-v-o told me what was wrong and fixed it.
I'll update the templates tomorrow to fox this and other things, but if you cant wait, just replace the MovePlayerEx function in the global script with this one:
Code: ags

/**/function MovePlayerEx(int x, int y, int direct){
/**/  //Move the player character to x,y coords, waiting until he/she gets there, but allowing to cancel the action
/**/  //by pressing a mouse button.
      int cursorspritenumber=33,
          blankcursorspritenumber=34;
      ChangeCursorGraphic(7,cursorspritenumber);
/**/  GScancelable=0;
/**/  if (direct==0) MoveCharacter(GetPlayerCharacter(),x,y);
/**/  else MoveCharacterDirect(GetPlayerCharacter(),x,y);
/**/  // wait for release of mouse button
/**/  while (character[GetPlayerCharacter()].walking && ((IsButtonDown(LEFT)==1) || (IsButtonDown(RIGHT)==1))) {
/**/    Wait(1);
/**/    RefreshMouse();
/**/    CheckDefaultAction();
/**/  }
/**/  // abort moving on new mouse down
/**/  while (character[GetPlayerCharacter()].walking){
/**/    if (IsButtonDown(LEFT)==1 && (GetGUIAt(mouse.x,mouse.y)<0 || GetInvAt(mouse.x,mouse.y)>=0)) {
/**/      StopMoving(GetPlayerCharacter());
/**/      GScancelable=1; 
/**/    }
/**/    else if (IsButtonDown(RIGHT)==1 && (GetGUIAt(mouse.x,mouse.y)<0 || GetInvAt(mouse.x,mouse.y)>=0)) {
/**/      StopMoving(GetPlayerCharacter());
/**/      GScancelable=2;
/**/    }
/**/    else {
/**/      Wait(1);
/**/      RefreshMouse();
/**/      CheckDefaultAction();
/**/    } 
/**/  }
/**/  ChangeCursorGraphic(7,blankcursorspritenumber); 
/**/  if (GScancelable==0) return 1;
/**/  else return 0;
/**/}
#27
Warst: you could do a custom SwitchPlayerCharacter function that, apart from changing the player character, also changed some gui buttons pics to the ones you want, and, in the interface_click function, in those buttons, check who is the player character to see what action is done, ie:
if (button==4){
if (GetPlayerCharacter()==PLAYER1) SetMode("talk to");
else if (GetPlayerCharacter()==PLAYER2)SetMode("lie to");
}
Or you could just do different guis for each character.

Elvis: check this thread: http://www.agsforums.com/yabb/index.php?board=2;action=display;threadid=6642
EDIT: oh, the server seems to give a forbidden access error...
#28
i think you could try to do it with hotspot's properties.
Like, in those hotspots that define the exits, you could make a property called 'exit' or so, and then define the direction (in order to set the correct arrow later).
Then in the repeatedly execute check if the property 'exit' is up, down, left or right, and, if it is, set the cursor image to the corresponding arrow, and if its not, set the default image.
Just an idea, never tried it or anything.
#29
QuoteCan I point out that the unhandled_event thing breaks completely in 2.6betas due to the new function type checking
yes, tomorrow after work i'll upload the new versions..., now im going to bed :)
QuoteGoToCharacter(MEL,2,0,1);

I have discovered that this command makes the player character walk to that character that is displayed and turns to him but I'm not sure what the numbers are standing for and the command isn't in the help part. Does any know the fully information behind this command?
yes, the commands are:
1)- int CharID >of the character you want to go to;
2)- int direction > at which side of the character the player must go and stay:
0 - the shortest way;
1 -up (behind)
2 -right
3 -down (in front of)
4 -left
3)- int npc faces player > if 1, the npc will face the player character, if 0 he won't
4)- int blocking> 1 blocking, 0 nonblocking
#30
oh yes, i see.  :-\
You could try to find that:

if (GetCursorMode()==4 && GetLocationType(mouse.x,mouse.y)==2 && Mode("give")){

in the LEFT button interaction in the on_mouse_click function in the global script, and then replace it with:

if (GetCursorMode()==4 && GetLocationType(mouse.x,mouse.y)==2 && Mode("give") && GetCharacterAt(mouse.x,mouse.y)<3){

tell me if it worked! :)

EDIT: btw, the unhandled event function is buggy, i think i'll have to redo it. sorry, but there is only a template user that is telling me the errors he is getting, so i cant ensure that it will work just fine.
And maybe this shoud be in the lucasarts interface thread, im not sure  :P
#31
The templates were last edited with a beta version :-\ sorry.
you will need that.
SMF spam blocked by CleanTalk