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

#1
Hi everyone,

i'm using a double click code which is working just fine, the only time it doesn't work is when i double click a gui button.
If i double click the gui it works but not the button on the gui.
I tried with different gui and buttons but always the same result.

Here is the code for the button on the gui which doesn't work:

Code: ags

function btnPocketPC_OnDoubleClick(GUIControl *control, MouseButton button)
{
  gPocketPC.Visible = true;
}
function btnPocketPC_OnClick(GUIControl *control, MouseButton button)
{
// Double click
  if (mouseTimer>0 && mouseTimer<14 && mouse.IsButtonDown(eMouseLeft))
  {
     btnPocketPC_OnDoubleClick(control,  button);
      return;
  }
  mouseTimer=0;


And here is the code for the gui where the button is on, which works:

Code: ags

function gIcon_OnDoubleClick(GUI *theGui, MouseButton button)
{
  gPocketPC.Visible = true;
}

function gIcon_OnClick(GUI *theGui, MouseButton button)
{
 // Double click
  if (mouseTimer>0 && mouseTimer<14 && mouse.IsButtonDown(eMouseLeft))
  {
      gIcon_OnDoubleClick(theGui,  button);
      return;
  }

  mouseTimer=0;
}


I looked everywhere but i don't seem to find a solution.
Is there any other way to double click a button?
Any help is appreciated:)
#2
Hi,

I really suck at geometrics so I have to ask you guys. Basically I want an object to fly from a certain point(x1,y1) to another(x2,y2) in a parabolic curve. The starting point would be the position of the main character throwing an object into a window.

I'd really appreciate your help.

???
#3
Hi,

I have a couple of  questions about the raw images:

1) Is there any way to save the raw images created in a room? I want them to remain at the same positions when the player character leaves the room, and then they should reappear after the player character enters the room again.

2) Also, is there a way that the raw images are drawn behind the walk behinds in the room, because that doesn't seem to work.

#4
Hey,

I'm having a little problem with the change room command. The player finds a letter in the game. If he looks at it in the inventory screen, the player changes the room, where he can read the letter(the letter is the background of the room). After he's done reading it, I want that the player changes to the room he was previously in, but I don't know how. With the change room command I can only choose a specific room, but not the room from where the player actually looked at the letter in the inventory screen. Maybe I missed sth, but what?

Thanx for you help
#5
Advanced Technical Forum / blocking script
Mon 27/03/2006 15:04:18
Hey, I have a little problem:

the player is waiting for the bus. Once the bus arrives the player can click on the open door and so enters the bus. Then the bus closes its door and moves out of the screen.Here is what I wrote:


if ((mouse.IsButtonDown(eMouseLeft))&&(mouse.Mode == eModeWalkto)&&(mouse.x >=228)&&(mouse.x <=256)&&(mouse.y >=79)&&(mouse.y <=170)&&(timer >=301))

player.Walk(240, 192, true)&&
character[ARTHUR].ChangeView(25)&&
object[16].SetView(24, 3)&&
object[2].Animate(2, 3, eOnce, eNoBlock, eBackwards)&&
object[2].Move(500, 190, 1, eNoBlock, eAnywhere);


if ((timer >=301)&&(character[ARTHUR].View ==25))
object[16].Visible =false;


if ((timer ==305)&&(character[ARTHUR].View ==25))
object[2].Animate(1, 1, eRepeat, eNoBlock, eForwards);

if ((timer ==305)&&(character[ARTHUR].View ==25))
object[2].Move(500, 190, 1, eBlock, eAnywhere);



if ((timer ==310)&&(character[ARTHUR].View ==25))
object[2].Move(500, 190, 2, eBlock, eAnywhere);



if ((timer ==315)&&(character[ARTHUR].View ==25))
object[2].Move(500, 190, 3, eBlock, eAnywhere);


if ((timer ==320)&&(character[ARTHUR].View ==25))
object[2].Move(500, 190, 4, eBlock, eAnywhere);


if ((timer ==325)&&(character[ARTHUR].View ==25))
object[2].Move(500, 190, 5, eBlock, eAnywhere);


if ((timer >=330)&&(object[2].X >=450))
player.ChangeRoom(10,274,122);

The problem is that the sript only executes the first two commands, and then stops. I set the player to view 25, which is a black screen, so that the player becomes invisible. Object[2] is the bus and object[16] is the open door of the bus. So when the player clicks on the open door, the player disappears and comes back as a part of object[16] (the backside of the player can be seen, when he stands on the stairs of the bus, and then completely disappears when the bus closes it's door. I don't know what the problem is, but it looks like a blocking script.

I've already wasted too much time with this,  help would be great

#6
Hey, I looked everywhere but I can't find a solution to my problem.
Here it is: when the player walks in front of a car who is passing by he is instantly killed, but the animation comes too late. The car is an object and I used the following code in the global script:

if (character[ARTHUR].IsCollidingWithObject(object[12])==1)
player.LockView(15)&&
player.Animate(0, 5, eOnce, eNoBlock, eForwards)&&
Wait(120)&&
QuitGame(0);

The animation only starts when the car is already one third passed the player, but I want that the animation starts the moment the player is hit by the car and not later. I tried using a different object (a bumper)
and placed it on the car. However that doesn't did any good, because the animation only starts when the player is at same y axis than the car. So when the players feet are at same position as the car's wheel (and not the bumper) the animation doesn't start. So I replaced the bumper by an black 25*10 image (it is exactly as high than the street) that I placed before the car (the image is invisible in the game), so that the player would be killed at the correct moment, but the animation didn't start at all.
I thought of making the street an region and write a script when the player stands on it, but I encountered another problem (the subject of the topic):
the center of the car is at the very end, on the bumper, and I wonder how the center can be changed to the front of the car, there where the player should collide with it and then be killed.

Some help would be great



#7
Hey, I have a problem, and I don't see the solution. The player is in a room with a lamp, that the player can turn on and off, and also with a roller shutter, that the player either can close half or close completely. The lamp is an object, and the roller shutter is a different background frame. Everything works fine in the room, but when I leave, and then enter the room again, the background frames are changing all the time and the lamp is constantly going on and off. I want that the background remains the same, after the player reenters the room,so that the roller shutter is still rolled down and the light is still on.

Please, some help
#8
Hey, I have a problem when the player changes the room. When the player changes the room at the moment a car is passing by, the car remains at the same place as before, when the player returns to the room. The car is  an object, here' s the script:

// script for Room: First time player enters room

object[3].Visible = true ;
object[3].SetView(8,0) ;
object[3].SetPosition(-300,210) ;
object[3].Solid =1;

// script for Room: Repeatedly execute

timer++;

if (timer ==40)
object[3].Animate(0, 3, eRepeat, eNoBlock, eForwards);
if (timer ==100)
object[3].Move(400, 210, 7, eNoBlock, eAnywhere);

  // script for Region 1: Player walks onto region

player.ChangeRoom(2,110,105);

Thanks for help!

SMF spam blocked by CleanTalk