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

#1
Thanks for your answer and I apologize for my late reply.

First of all, the code that I posted works, but only half of the time and only because I added your Display function to my code.
Here are the results:

If I click the first time on the button the display function shows 1000 (thats the value of the mouseTimer, declared in the Global Script).
After that the value keeps changing, depending on how fast the mouse get clicked.
Although I have to say, the numbers that are getting displayed seem a little random, because sometimes the code works (the gui gets displayed), and sometimes it doesn't work, even though I click as fast as the other times or even faster.
If I'm trying to click as fast as possible the value varies from 10 to 25 approx.
Hope my answer is clear enough for you.

Thanks in advance!
#2
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:)
#3
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.

???
#4
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.

#5
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
#6
Advanced Technical Forum / Re: blocking script
Tue 28/03/2006 10:06:58
if i don't use "&&", then the player instantly disappears when he first enters the room, and the bus stops on the wrong place, the door is open, and when I click with the emodewalkto on the door, the bus closes its door and moves out of the screen. So the end is ok, but the beginning is a clomplete mess. Can't it be that I wrote the script too long winded and not simple enough?
#7
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

#8
I tried what you said, but I still get the two same error messages for the two commands
#9
I used:

if (AreThingsOverlapping(1012, ARTHUR)) {
  player.LockView(15);
  player.Animate(0, 3, eOnce, eNoBlock, eForwards);
  Wait(120);
  QuitGame(0);
}

but I got the following error message:
Error: AreThingsOverlapping: invalid parameter

I also tried

if (obejct[12].X >= cArthur.x - GetGameParameter (GP_SPRITEWIDTH, object[12].Graphic, 0, 0)) {
  //If the object is closer than it's own width to ARTHUR
  player.LockView(15);
  player.Animate(0, 5, eOnce, eNoBlock, eForwards);
  Wait(120);
  QuitGame(0);
}

but there again I got an error message:

Error(line44): undefined symbol 'object'


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



#11
Thanx Funky, it's working ;D
#12
Stupid question: How do I write another equation, if I want a different speed?
#13
Yeah, that's right, you've understand the problem. I'm gonna try it now...

EDIT:
Yeah, thanx it worked Grin

but isn' t ther an easier way to write it, instead of

if (timer <110)
object[3].SetPosition(-340,200);
else if (timer <120){
object[3].SetPosition(-330,200);
}
else if (timer <130){
object[3].SetPosition(-320,200);
}
etc
#14
Problem fixed,

thanx
#15
One problem is solved, namely that the car has disappeard when the player reenters the room, but there is another problem; the car is passing at speed 1, the player leaves the room, and immediately reenters and the car has disappeared. What can I do to make the car visible and that he still continues moving slowly out of the screen.

I used
 
if (timer >= 100 && object[3].Moving == false)
object[3].Move(400, 190, 7, eNoBlock, eAnywhere);

in the global script to make the car disappear when the player reenters rhe room,but I don't quite get it what you want to do with the

if (timer <100)object[3].Setposition(-300,190);
if (timer <120)object[3].Setposition(-250,190);


#16
If I change the car to a character doesn't work either. The car is still at same position when the player reenters the room. 
#17
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
#18
Yes the car has to disappear. But the thing is : we want the time to run continously, so that if you're outside of a house and a car is passing by, and you enter the house and rapidly come out again, the car would still be finishing his movement

thx for your attention
#19
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