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

#21
To Gilbot,
Thanks for the reply. Ã, I tried what you said and used :

Code: ags

if (HasPlayerBeenInRoom(1)==0){
 Ã,  NewRoomEx(1,100,100);
}


This is on the hotspot in room 3 which is on the entrance of room 3. I can go into room 3 but still cannot go back to room 1 from room 3. Ã, Basically whatever room I am in I would like to go back to the room I came from. Ã, Is this possible???

Also would you or anyone be able to answer some more stuff..stuff that I mentioned previously:

Quote
Oh yes one more thing. Ã, In rooms 1,2 and 3 the inventory window seems ok and displays the items properly so that they all show but in room 4 my inventory window spans across the from left to right so much that you can't see any of the items on either end as they are only half showing. Ã, How can make my inventory window display all the items I want to display so that they all show properl???.

from Bhup Ã, :)


#22
To jrl2222,
Quote
What do you have as the script for your room 1 exit?Ã, 

The code I have for the hotspot which exits to room 3Ã,  is not a script command.Ã,  It is simply the option chosen from the the hotspot interaction menu. It is: Player - Go to a different room (at specified coordinates)(3,232,168).

Quote
Only a guess here but you may have the player character going to room 3 and starting out on the hotspot? That would be the obvious thing.

Could you please expand on this...I'm not quite sure what you mean.

Oh yes one more thing.Ã,  In rooms 1,2 and 3 the inventory window seems ok and displays the items properly so that they all show but in room 4 my inventory window spans across the from left to right so much that you can't see any of the items on either end as they are only half showing.Ã,  How can make my inventory window display all the items I want to display so that they all show properly.

ThanksÃ,  Ã, :)

Bhup
#23
I am probably going to be told that this explanation allready exists but I have tried and I have a limited budget...err can't be online to long.

Problem: As title suggests How do I go back to a room that I have allready been to? I am in room 3 and want to go 'back' to room 1.  I have created a hotspot in room 3 just before the exit back to room1.
I used ther following command : Player - Go to a different room(1,100,100).

But when I ran the game the character went through to room 3 from room1 and went right back out again back to room1 .

I can see why this happened so I tried using:
if (!(HasPlayerBeenInRoom(1))){
   NewRoomEX(1,100,100);
}

This allows the character to go into room 2 but does not allow it to go back to room 1.

Again I can see why but I am wandering wheterh I am missing the obvious.

Could someone please help.
Bhup
#24
Thanks Snarky and Strazer,

You have been a great help!

Oh yes Snarky I managed to view that link: 'Background Art versus animation on the screen'.  It helped... as there does appear to be a dilemma between Object switching and Background switching.  I'm sure we all know that you use a bit of both depending on the situation....err..I suppose. Least thats what I think.   ::)
Bhup
#25
Snarky,
Thanks for replying.  :)

Yes, I didn't notice that you had written an Epic  :P on a portion of my game.  I guess I did not see the bit under 'Edit' I only read the first paragraph of your reply before which was helpful. The pictures you have drawn pretty much explains what I am trying to do (btw, the pictures are very good,  for the purpose you used them for). I realise that switching objects on and off is probably the key to constructing what you told me I need to know and I 'allready' know what I want to do.  It s getting to use the script commands which is the problem. So if anyone cares could they please help me on the following:

1. How do you make a character appear from the boat to the beach without
the character walking in the water.  MoveCharacter e.t.c. moves the character in a a straight line, the other s do the same.  I just want to make the character appear from one position to the next thart is on the boat to the beach without him going in the water.

2. Does anynone know if you can create a hotspot on a newly created background other than the first one that is, setBackground 0. I want to create a hotspot on all backgrounds from background 1 onwards.

Bhup


#26
Snarky,
Thanks that clears it up. 
Hmm.. but I am still inclined to think that it can be compared to a Java thread. Since you have many 'processes' running side by side e.g. ...'Can't move frames e.t.c' and 'say background animate the character' e.t.c.  Or do you beg to differ?

Also Strazer made a very good point about switching objects on and off to create changes to my scenes everytime an inventory item was clicked with a hotspot and I wanted the scene to change. I will make use of that but I am curious (and this is to anyone that wants to answer),how do you create a hotspot on a new background, such as background 1, or, any other background that is created other than background 0 .  I just feel that switching objects on and off my not meet all my needs in the long run.
Bhup
#27
Strazer,
1. I am familiar with threads in Java.  They are usually used for multitasking... you know...overlap input and output operations with processing.  Is this the same definition/concept in AGS??

2. I also understand that threads for example allow processes in a program that need to be continuously running, such as a continuously running animation, to be overlapped with other activities in the program.  This again is another Jave concept.  Hence is the definition more closer to the this???
Bhup
#28
QuoteAbsolutely! I should've read the thread more carefully
Pourquoi? Qu'est ce que vous mean by thread  ?

QuoteAbsolutely!
I'm getting good at this!


QuoteBut if you really want to do it that way, why not turn off the object after the animation has finished?
Seems like a very good idea...I shall try this.

QuoteBut since you want to animate only the character anyway, I suggest you simply animate the character, not fill the whole screen with an object animation.
Hmmm...I am more inclined to
Quotefill the whole screen with an object animation.
Will small scene I'm animating...will that be considered some kind of 0bject and can it be turned on and off like an object.  I can't quite visualise how animating the character will work because if you want to animate the character throwing a sword attached to the rope whilst in a boat to a lifebuoy...I just can't see it...what am I missing besides my brain??

(p.s. Mirc u sometime  ;) )
Bhup





#29
Hello there Strazer,
I did the following as you recommended:

Ã, // script for hotspot1: Use inventory on hotspot

SetObjectView(7,3);
ObjectOn(7);

// AnimateObject(7,0,40,0);

AnimateObjectEx(7,0,40,0,0,1); // play animation once, blocking

Display("Hi Bhupinder!!!! How are you today"); Ã, //I left this bit in to see if
Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã, //it executed next
Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã, //command....It did.

SetBackgroundFrame(1); Ã,  Ã,  Ã,  //I 'did' import the right frame and it 'is' number
Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã, //1. Ã, However, it still appears as though
Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã, //the frame is not being displayed because the
Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã, //last frame of the animation just remains there.
Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã, //I 'think' I know what might be happening....

The animation starts from an object which is at the bottom left hand of the screen. Ã, The animation is 640 by 480 and fills the entire screen rather than a portion of the screen. Ã, When I call SetBackgroundFrame(1) it probably 'does' display the background but it it can't be seen because the last frame of the animation is in the foreground. Ã, Could this be the case????

If so I do I get rid of/switch off the last frame ????
Bhup
#30
Hello there Strazer,
I did the follwing as you recommended:

  // script for hotspot1: Use inventory on hotspot


SetObjectView(7,3);
ObjectOn(7);

// AnimateObject(7,0,40,0);
AnimateObjectEx(7,0,40,0,0,1); // play animation once, blocking
Display("Hi Bhupinder!!!! How are you today");  //I left this bit in to see if
                                                                            //it .executed next
//command. It did.
SetBackgroundFrame(1);

#31
Strazer,
Ok forget the 'looping' animation.  I have my reasons for the looping but I wont go into that now.  It's sufficient to just run the animation once.  Heres the code:

// script for hotspot1: Use inventory on hotspot


SetObjectView(7,3);
ObjectOn(7);

AnimateObject(7,0,40,0);

//Display("Hi Bhup!!!! How are you today");

// As you can see I did try the 'Display' and when
// I clicked on the lifebuoy(hotspot), it immediately
// displayed the message.  I had to click the screen to
// start the animation.  Funny that..I thought the
// animation would have started before the
// message?!?

SetBackgroundFrame(1); //This does not execute or
                                        // show the new background


// The code below is just stuff I was messing around
// with to see if I could come up with a solution

//AnimateObject(7,0,40,1);
//AnimateObjectEx(7,0,40,0,0,0);

//while ((IsKeyPressed(27) == 0) && (IsObjectAnimating(7) == 1)) {
//  Wait(1);
//}

//SetObjectView(7,14);
//NewRoom(1);

// ObjectOn(8);

It seems that after the AnimateObject is run once it stays on the last frame no matter what the next command is.

Oh yeah by the way  :-X


Bhup
#32
Strazer,
No problem. p.s. Hope I got the German correct...yes I know no chatting in the forum  :-[.

Here is the code it is in response to the interaction button of a hotspot.  This hotspot is a lifebuoy on a beach.  The character is in a boat and can't get out of it due to killer jellyfish surrounding the boat.  The player has to combine the rope object with the Sword object which are in the boat.  After combining the two, a picture appears in the inventory of the sword attached to the rope.  Then in order to get out of the boat the player must click the sword attached to the rope, on the lifebuoy.  A short animation then follows of the character throwing the sword at the lifebuoy.  I want to show the final picture "after" the animation of the rope tied to the boat and the other end attached to the lifebuoy(that is, the sword in the middle of the lifebuoy), with the same objects displayed in the boat that have not yet been put in the inventory.   I also wanted to loop the animation and allow the user to quit/escape the aimation at any time and for the next scene not room to be displayed. 

The only way I can think of stopping the animation is by using SetObjectView after the while loop.  (With hindsight I realise now that I did not explain myself very well in th last reply..I was not very focussed at the time. ),  however I can't seem to display the final picture after the animation containing the objects that had not been pu tin inventory.  The code follows:

SetObjectView(7,3);
ObjectOn(7);


AnimateObject(7,0,40,1);


while ((IsKeyPressed(27) == 0) && (IsObjectAnimating(7) == 1)) {
   Wait(1);
}

SetObjectView(7,14);
// Want to display final picture after it stops here,
// but seems as if code will not execute passed
// SetObjectView..ps..how do I display new picture
// with rope tied to boat containing objects in
// room1/first scene that hasn't allready been put in
// inventory.

// NewRoom(1);  I tried this for a reason butI forget now

// ObjectOn(8);  Same reason as room.

Hope this makes sense.   :)
Bhup
#33
Herr Strazer,
Ich begruBe sie alle..es freut mich, sie kennenzulernen
(she writes, after quickly going through a German phrase book she once used in Germany after working there for two weeks and no longer uses..cause it's too **** hard.) :D

I tried my hardest to look for an alternative to stopping the animation midway within the allotted time I have.  I used SetObjectView(7,14) as you said and it did stop the animation but how do I retrieve my current room i.e. room 1 which contains all my objects and background that i still need.  I tried putting NewRoom(1) after SetObjectView but it does not seem to execute past SetObjectView.  It stays on view 14 and basically does nothing.  What am I missing here???

If there is no answer then I will have to stick to running the animation once and allowing the user to click on the hotspot and that way they can run the animation again. 

Bhup
#34
Dear Strazer.
Do you know what?...when you come up with an answer...it then seems soooo ::) obvious.
Again I am eternally greatful for your help. Ã, But Herr Strazer I 'yust'(just) have wan leeetle question..err..sort of.

I tried changing the background because I allready had one and wanted to avoid the task of creating a single object. Ã, Anyway I went into Room Editor, Settings. Animating background and imported the background I wanted. Ã, I then added the statement:

SetBackgroundFrame(1)

at the end of the runscript code of the of the hotspot. Ã, I executed the game and immediately from the start, the background kept animating/looping between the two background. I couldn't for the life of me find out what is causing this.

Secondly, I finally forced myself to create an object and use the 'object'approach. Ã, My code only seems to respond to 'escape' if there is 'NewRoom' command at the end of the while statement, thus:

SetObjectView(7,3);
ObjectOn(7);


AnimateObject(7,0,40,1);


while ((IsKeyPressed(27) == 0) && (IsObjectAnimating(7) == 1)) {
Ã,  Wait(1);
}
NewRoom(2);

If I put anything else there such as : ObjectOn(8) the animation sequence continues to loop when I press escape.

I am curious to know the answer using the background 'and' the object method. Could you please help once again Herr Strazer????
Fraulein Bhup
#35
Dear Strazer.
Do you know what?...when you come up with an answer...it then seems soooo ::) obvious.
Again I am eternally greatful for your help.  But Herr Strazer I 'yust'(just) have wan leeetle question..err..sort of.

I tried changing background because I allready had one and wanted to avoid the task of creating a single object.  Anyway I went into Room Editor, Settings. Animating background and imported the background I wanted.  I then added the the statement SetBackgroundFrame(1) at the end of the runscript code of the of the hotspot.  I ran it
#36
Dear Strazer,

Thanks.  Your a genius!!!!
I tried your first answer to my first question that is :

Animate(0,0,40,0);

Initially before you told me I used this to loop my animation but the escape wouldn't work because I was using Animate(0,0,40,0) in side the while loop that is :

while ((IsKeyPressed(27) == 0) && (IsObjectAnimating(7) == 1)) {
      Animate(0,0,40,1);
      Wait(1);
}

But I realise now that your supposed to use it after the Animate command.  I did not realise that the while loop containing the IsKeyPressed(27) command could be executed after Animate because I thought the animation sequence would finish before the while was executed.  It is a little confusing.

Anyway I used the second command you gave me after the animate sequence.  Before I run the command you gave me I actually go into another room. (NewRoom(2)).

Room 1 contains a picture without the rope and room 2 contains a rope tied to the pole on the boat.   What I want to do is display the new picture (the rope tied on the pole on the boat ) after the animation is over and I want it to have  the same objects that were not put in inventory in the first room or picture.

The only way I could think of displaying the new picture was by going into a new room( Room 2).
And then I thought how do I display the same objects that were not in inventory in room 1, I figured I needed some way of knowing what was in inventory allready and then use Object off to delete the object if it was allready in the inventory.

Hence the command you kindly gave me:

if (character[TOMSCRIPT].inv[0]) { // if character EGO carries inv item 11 (one or more)
    ObjectOff(0);   


This however does not work the way I want it to.

Sorry for the laborious explanation, bascially do you know of a better way I could display the new picture after the animation sequence in room 1 containing the same objects that are currrently in room 1.

Hope you or anyone else don't mind answering this tedious question.
Bhup
#37
One more thing as well as needing a reply to the escaping an animation could you also please tell me how to detect whether an inventory item exists in the inventory?
Merry Xmas to one and all.
Bhup
#38
Is there anyone out there prepared to answer the above question.  Or is Christmas keeping every one at bay. ;D
Hope to hear from someone soon.
Bhup
#39
Dear Scorpirous,

I did what you told me to do but it only put a timer in place of the cursor.  I did:

SetObjectView(7,3);
ObjectOn(7);

AnimateObject (7,0,40,0);
while ((IsKeyPressed(27)==0) && (IsObjectAnimating(7)==1)) Wait(1);

ObjectOff(0);

What happened is that it went through the animate sequence once then stopped.  But thats what animateObject was programmed to do err...Go through animate sequence once. :P

What I want to do is loop the animated sequence and  allow the user to escape the animation any time.

I tried changing the number of times the animation was played by swapping the 1 to a zero in AnimateObject.  Sure enough it looped but the while statement you gave me does not seem to work ???  If its supposed to allow the user to escape it does not work ???
Bhup
#40
Dear Pumaman or anyone else that is interested in answering my question.

I have so far  written the following code:

SetObjectView(7,3);
ObjectOn(7);
ObjectOff(0);


AnimateObject (7,0,40,1);

It works...the animation now starts at the bottom left of the screen where I placed the "default blue cup".  But what I am now looking for is a way to allow the user to escape the animation by clicking or pressing on the Escape key (code 27).

I have created the following code:
SetObjectView(7,3);
ObjectOn(7);
ObjectOff(0);

while(IsKeypressed(27) != 1){
AnimateObject (7,0,40,0);
}

But it only displays the first frame of view 3.

Basically it doesn't work.  What am I doing wrong please???
Bhup :'(
SMF spam blocked by CleanTalk