Please somebody help. I have looked in the forum for an answer to this question but cannot find one without running up a huge bill,despite this I have looked really hard for a solution in the forum, so please don't attack me...the answer to my problem might be staring me in the face but I just don't see it.
I am trying to create a cutscene or an animated sequence of frames in response to the main character clicking an inventory item on a hotspot. In the interaction editor of hotspot 0 I use a conditional event:
conditional-if inventory item was used(9):
I then run a child script:
SetObjectView(0,3);
AnimateObject (0,0,40,1);
but when I run it, instead of the animation (frames), running from the bottom left of the screen they start halfway up the middle of the screen. I have tried looking for a "setPosition" of some kind but cannot find anything which moves the frames I want to animate, to the bottom left of the screen.
Please somebody help I would be most greatful.
bhup
SetObjectPosition.
I think the function you want is SetObjectPosition.
I had this same problem when I started an object with one view and then changed to another view with different dimensions. An easy way to find the right position is change the image of the object in the editor, move it to the right position and note the coordinates.
Can't you just put the object on the right position in the editor?
Thanks all for replying so soon :)
I am allready aware of SetObjectPosition but this does not work. It refers to an object not the frames in "view3" that I am trying to animate. I don't see that each frame in "view3" are objects. Or are they? If so how do I know what object number they are. Am I wrong or right??
Is the problem here that the animation plays in the wrong position on the screen? If it is, you could try just moving the object 0 in that room down the y axis?
Dear Ishmael, :)
I don't see how moving Object 0 would help. It is part of the background and I have made it a hotspot in the Room Editor under 'Areas'. Sorry I am unable to show example of pictures. p.s. In the Objects section of the Room Editor all the inventory items are referred to as 'objects'. I hope I am not confusing the issue by refering to the hotspot as 'object 0' as it is the only hotspot in the Areas of the Room Editor. Could you possibly confirm this.
Alos the character is supposed to throw a rope with a sword attached to it, to a lifebuoy as soon as the user clicks on the lifebuoy with the sword attached to the rope. The otherside of the rope is attached automatcally to the boat. I want to animate the sequence where the character is seen to be throwing the rope. (Sorry for sounding so laborious). But when I do this the bottom left of each animation frame starts around the middle of the screen. Could you please help again? :P
Bhup
Ah, here's the thing.
First you set the object to a position.
Then you assign a view to the object.
Then you animate the object.
A view never animates on its own. It must be a character or object that uses it.
Yes, in the Objects section under the Room Editor just click the "New Object" button, click on the room view to place it, set it's view to the view you've made for the animation, and tick the box to hide the object.
Then, when you want the animation to play, put ShowObject(0); before the AnimateObject command in case the object doesn't show up automatically when the animation command executes.
Dear Ishmael or any one else that wants to help :P
Sorry to bother you again but I am a little confused. I know how to create new objects by clicking on the "New Objects" button in the "Room Editor" under "Objects" but I don't understand the bit about :
"click on the room view to place it, set it's view to the view you've made for the animation, and tick the box to hide the object."
Do you mean the "Change image" button in the "Objects" section of the "Room editor"?
If so then the thing is the lifebuoy is part of the background and I have made it into a hotspot in the "Room Editor" under "Areas". I have created a script containing the following commands:
SetObjectView(0,3);
AnimateObject (0,0,40,1);
This script was created by clicking on the interaction button for the hotspot which I have labelled as ring (don't ask me why I called it this), in the Room Editor under Areas.
What I want to do is run an animation when an inventory item (in this case a rope attached to a sword), is used to click on the lifebuoy (the hotspot). So far this displays the view3 i.e. each of the frames, but the bottom left hand corner or the starting position of each frame starts somewhere in the middle of the screen.
Ishmael, are you saying I should convert the hotspot into an object? If so then I will try it but it means having to go back to the drawing board. If that is the only way then so be it. Is this the what you mean? :)
Slightly confused
Bhup
These commands:
SetObjectView(0,3);
AnimateObject (0,0,40,1);
are animating Object 0. Therefore, the animation will take place at wherever Object 0 is on the screen, and this is set by where you place it on the Objects tab.
You cannot animate a hotspot since it is a static part of the background, but you can have an animating Object on top.
By saying "set it's view to the view you've made for the animation" I meant using SetObjectView and to set the view to that animation. As you have done with that script already.
Just set the object graphic to something that you can find on the background if you need to move it a bit if the animation looks misplaced.
Dear Ishmael :),
Thanks for all your advice. I'll give your last comment a go. It seems to make sense. Thanks a lot ;D Do we give out points for something like this??? Since I don't have any to give. In Java they give out credits and if you have a certain number of credits you get a prize. Is it the same here??
Thanks Punaman. Just one thing...err..hope you don't mind me saying that I am allready aware of the fact that you can't animate a background but you can create an animation as a result of clicking on a hotspot in the background. My problem was that the animation started at halfway in the middle of the screen where my hotspot, which was part of the background, was. But I think Ishmael has solved the problem. :)
Thanks everyone!!
Bhup
Dear Pumaman
Actually I meant I should be thanking Pumaman for the advice about Objects 0. I am thinking of creating an 'object' that is hidden and putting it in the extreme bottom left hand corner. I am not sure how to hide it. Any ideas?? Meanwhile I will have a hunt around in help. Could sure do with your advice again though Pumaman.
P.s. Is there any way we can change elements of our profile???
Bhup :)
Objects have a "Object is initially visible" checkbox in the editor. Just un-check this, then un-hide the object when you want to run the animation by using ObjectOn.
Dear Pumaman and Ishmael I thankyou both for helping me.
:-* If I could read like the "idiot" I am I would have read your comments earlier. :-[ Had i been more focussed I would have understood what you were saying. ;D I have just learned how to hide the object!
Sorry Pumaman for asking such a trivial question in the wrong Forum. :-[
Bhup
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 :'(
Try the following:
SetObjectView(7,3);
ObjectOn(7);
AnimateObject (7,0,40,0);
while ((IsKeypressed(27)==0) && (IsObjectAnimating(7)==1)) Wait(1);
ObjectOff(0);
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
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
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
Quote
What happened is that it went through the animate sequence once then stopped.
Try the above code with
AnimateObject (7, 0, 40,
1);
This way, the animation is looped. You can skip it with the ESC key (ASCII code 27).
Quotehow to detect whether an inventory item exists in the inventory
If you want to know if a character is carrying a specific item, do
if (character[EGO].inv[11]) { // if character EGO carries inv item 11 (one or more)
// do stuff
}
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
The code got mangled, I suppose you were doing
if (character[TOMSCRIPT].inv[0]) {
ObjectOff(0);
}
?
If so, it doesn't work because there's no inventory item 0! :P
However, there's no need to change rooms!
Why don't you stay in the room and just turn on another object that shows the rope tied to the boat?
You could also draw another frame for the background and set it with SetBackgroundFrame.
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
Sounds like the background started flicking those two frames right away, or? If this is the case, adding SetBackgoundFrame(0); to the Player enters screen (before fadein) room interaction should fix it.
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
QuoteI 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.
Like Ishmael said, if you import additonal background frames into your room, they are being animated by default.
So setting the room background to the first frame (the normal background) when you enter the room should disable this animation. See above post.
Quotethe animation sequence continues to loop when I press escape.
Hehe, yes it does since you don't tell it to stop.
What we're doing is starting a looping object animation, then stopping the script to wait for the ESC keypress. Otherwise the object would just keep animating non-blocking in the background.
After the keypress we have to tell it to stop this animation:
while (IsKeyPressed(27) == 0) Wait(1); // wait for ESC keypress
SetObjectView(7, 3); // does this stop object animation?
(We don't need IsObjectAnimating anymore as it will always be true since the animation loops.)
I don't remember what the proper way to stop an object animation is, you can try re-setting the object view as I have done above or simply re-starting the animation, but this time non-repeating so it only animates once then stops.
Try a few things and please let us know how it turned out.
QuoteAgain I am eternally greatful for your help.
Gern geschehen (http://dict.leo.org/?lp=ende&lang=de&searchLoc=0&search=gern+geschehen). :)
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
I'm afraid you've lost me here. "Retrieving current room"? Are you changing rooms after all? ???
Maybe you could post the whole script you have written for this interaction. I'm confused...
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
QuoteA short animation then follows of the character throwing the sword at the lifebuoy.
That could also be accomplished animating the character itself.
QuoteI 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),
As I said, draw another version of the background or use an object that's initally off, containing a picture of the rope tied to the boat and lifebuoy.
Set the background frame or turn the object on after the animation.
Quotewith the same objects displayed in the boat that have not yet been put in the inventory.
I'm not sure what you mean.
Objects don't appear or disappear by themselves. They stay on/off if you don't turn them on/off and they're not affected if you set another background frame.
You don't draw stuff you can pick up directly onto your background, do you?
QuoteI also wanted to loop the animation and allow the user to quit/escape the aimation at any time
I don't understand why this animation has to be looped at all. What is he doing?
Quoteand for the next scene not room to be displayed.
Next scene? Another room?
I'm sorry, I don't know what you're getting at.
QuoteThe only way I can think of stopping the animation is by using SetObjectView after the while loop.
Glad that worked.
Quotehowever I can't seem to display the final picture after the animation containing the objects that had not been pu tin inventory.
What does happen? Do you get an error message?
Quote// Want to display final picture after it stops here,
Do you mean the last frame of the animation?
If so, try running the animation once again after the while loop, this time non-repeatedly, or just use SetObjectFrame.
Quote// but seems as if code will not execute passed
// SetObjectView
I doubt that's a bug. To be certain, put a simple Display command there to see if it gets executed.
QuoteHope I got the German correct...
Yes, very good! :)
Quoteyes I know no chatting in the forum
Not in the technical forums, anyway. ;)
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
QuoteFunny that..I thought the
// animation would have started before the
// message?!?
That's correct. It has been
started. Since it's a non-blocking command, the following script is executed immediately afterwards.
The reason you see the animation only after clicking away the Display message is that Display IS a blocking command, pausing the game while it runs.
The "while" was used to make the animation blocking with being able to skip it, since it was a looping animation. Making a looping animation blocking with AnimateObjectEx would make no sense since it loops forever, thus blocking the game forever.
But since we don't need a looping animation, we can make the animation run once, but make it blocking by itself so that the following code (changing the background) is executed after the animation has finished.
Change
AnimateObject(7,0,40,0);
to
AnimateObject
Ex(7,0,40,0
,0,1); // play animation once, blocking
Quote
SetBackgroundFrame(1); //This does not execute or
// show the new background
If Display is executed, so is this command. There must be something else afoul.
Are you sure you've imported the correct, changed background image as the new background animation frame?
Is 1 the correct frame number? 0 is the original background, 1 the first animation frame, 2 the second animation frame and so on.
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);
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
QuoteThe 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?
Absolutely! I should've read the thread more carefully, I didn't realize you were doing this.
It's generally not a good idea to use such large animation frames as the sprites (contrary to room backgrounds) are stored uncompressed in the game exe (for performance reasons) and thus increase the file size dramatically.
But if you really want to do it that way, why not turn off the object after the animation has finished?
I suppose since the object you've used is in the lower left corner, it covered all other objects you had in the room? In that case just set this object's baseline to the very top so that all other objects are always in front of it.
But 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.
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
QuoteQu'est ce que vous mean by thread?
Look it up it an dictionary. I honestly don't know how to describe it. It's this topic here we're discussing.
QuoteI 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...
Just draw animation frames containing the character, the rope and sword and animate the character with this animation. Just move the character to the place where the animation best fits into the background before starting the animation (so he hits the lifebuoy).
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
Nonono, a thread on a forum, a messageboard or a newsgroup is a discussion, like this. A group of messages where each response appears after the last. This thread is called "Can't move frames I want to animate to bottom left of screen".
Edit: Bhup, I'm reading this thread and trying to figure out what your problem is. It's giving me a headache. I really don't see where you can be going wrong, so the easiest thing might be to just demonstrate. I mocked up some incredibly crude pictures of the scene you describe, to show you how it can be achieved.
(Some people have been having problems seeing my pictures. If they don't show up in your browser, let me know and I'll see what I can do.)
Here's the background:
(http://members.lycos.co.uk/snarkibartfast/bkg.png)
And here are the object sprites:
(http://members.lycos.co.uk/snarkibartfast/boat.png) (http://members.lycos.co.uk/snarkibartfast/buoy.png) (http://members.lycos.co.uk/snarkibartfast/dude.png) (http://members.lycos.co.uk/snarkibartfast/sword.png) (http://members.lycos.co.uk/snarkibartfast/rope.png)
Put them all together and you get this:
(http://members.lycos.co.uk/snarkibartfast/complete1.png)
When the guy picks up the sword and the rope, you just turn those objects off.
Now you need an animation for the guy throwing the rope:
(http://members.lycos.co.uk/snarkibartfast/throw1.png)
(http://members.lycos.co.uk/snarkibartfast/throw2.png)
(http://members.lycos.co.uk/snarkibartfast/throw3.png)
(http://members.lycos.co.uk/snarkibartfast/throw4.png)
(http://members.lycos.co.uk/snarkibartfast/throw5.png)
(It's probably a good idea to make all of these equally big, because it makes it easier to position them, but I couldn't be bothered.)
When you run the animation, it will look like this:
(http://members.lycos.co.uk/snarkibartfast/complete2.png)
Finally you need a picture for the rope and buoy:
(http://members.lycos.co.uk/snarkibartfast/ropetied.png)
This is what the picture looks like after the animation is over:
(http://members.lycos.co.uk/snarkibartfast/complete3.png)
You'll need to turn off the old buoy object and turn on a new one for the rope and buoy once the throw is over, or change the sprite and reposition it.
Depending on what you want for hotspots and stuff, and differences between the animation you want and what I drew, you want to split up some objects into several, make more graphics for e.g. the boat, and lots of other things I haven't considered. This should give you the basic idea, though.
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
Bhup, see the edit to my last response. Regarding threads, yeah the two senses of the word are probably related.
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
I added the bit after "Edit" after you'd written your reply, so no wonder you didn't see it!
In order to instantly move your character from where it's at to somewhere else, it used to be:
character[EGO].x = ... ;
character[EGO].y = ... ;
(You need to fill in the numbers, of course.)
That's the way to do it in AGS 2.62. With AGS 2.7 (beta) I think it's a bit different, so if you're using that you should check up on it.
Changing the background image doesn't change the hotspots, I'm fairly sure. You'll have to do that explicitly. Use EnableHotspot and DisableHotspot. You can look those up in the help file that comes with AGS.
Edit: Your current predicament seems similar to this old thread (http://www.adventuregamestudio.co.uk/yabb/index.php?PHPSESSID=420099293717c4bea4c29c311bb55036opic=15401.msg188968). Unfortunately, the image link is broken.
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
Quote from: Bhup on Sat 01/01/2005 15:44:17
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??[/spoiler]
No that's a whole other concept. When strazer mention "thread" he wasn't talking about AGS but rather this forum. The first question you asked in this forum created a new topic or thread. So this is a thread of discussion (fil de la discussion).