Newbie trigger animated object question

Need help with using DizzyAGE then look here
Post Reply
Captain Jonesy
Your Backpack is Empty
Posts: 29
Joined: Mon Feb 15, 2010 12:27 pm

Newbie trigger animated object question

Post by Captain Jonesy » Wed Sep 29, 2010 1:37 pm

Hi guys,

I'm new to dizzy editing so I'm not sure if this is possible but I'm currently trying to script a trigger/set piece where when Dizzy talks to Daisy, heart appears above her head and it is animated flying off the screen. So far, I've managed to get the heart appear after Dizzy speaks to Daisy but unable to figure out how to animate the heart; this is what I'm scripted so far;

func ActionObject_1000()
{
Message2(5,6,"This is wondeful \n you are so romantic");
MessagePop();
ObjSet(ObjFind(1010),O_DISABLE,0);
}

I'm tried using waypoints but I don't think that function works within Actionobject command but any help from you guys would be great.

Jonesy

delta
Hard Boiled Egg
Posts: 3965
Joined: Fri Feb 09, 2007 7:08 pm
Location: North West
Contact:

Post by delta » Wed Sep 29, 2010 2:53 pm

any movement of objects needs to be done from the UpdateRoom function for that room. very similar to drips, birds, etc.

It should work fine using just one waypoint, but as I say, you need to use the UpdateRoom function. try having a look at part 8 of my <a href="http://dizzystories.110mb.com/tutorials.php" target="_blank">Video Tutorials</a> to see how to do the waypoint for the Bat.
Image

Image

"Quotes from the internet may not be genuine" - Abraham Lincoln

Captain Jonesy
Your Backpack is Empty
Posts: 29
Joined: Mon Feb 15, 2010 12:27 pm

Post by Captain Jonesy » Wed Sep 29, 2010 9:02 pm

Thanks again delta - you're been very helpful. Another quick question to pick you guys brains, what code do you need to make a cutscene only play once as everytime enter the room, the cutscene will play whereas I only want to play once and only. Thanks again for any help

delta
Hard Boiled Egg
Posts: 3965
Joined: Fri Feb 09, 2007 7:08 pm
Location: North West
Contact:

Post by delta » Wed Sep 29, 2010 9:08 pm

uhhh not quite sure i get what you mean. Either that or you're not quite understanding how DizzyAGE works with moving stuff around. If you just want it to move once, just move it once. Don't move it back to the original position :) simples!

A 'cutscene' is really nothing of the sort in DizzyAGE, it's just some movements of objects, with the player disabled.

EDIT:: on re-reading your question, I think I understand a bit better. The best way is to check the STATUS properties of the objects, so that they only move if the STATUS property is 0 for example (the default is 0). Then all you have to do is set the STATUS property to 1 (or 2, or 3, etc) when it's finished moving. That way, when it's next checked, it won't be 0, and therefore won't move! :)
Image

Image

"Quotes from the internet may not be genuine" - Abraham Lincoln

Captain Jonesy
Your Backpack is Empty
Posts: 29
Joined: Mon Feb 15, 2010 12:27 pm

Post by Captain Jonesy » Wed Sep 29, 2010 9:31 pm

Sorry I should explained myself more clearly. I think understand what you referring to, would place code such as (idx,O_STATUS)==0) before the cutscene and after the cutscene ObjSet(idx,O_STATUS,1); for an example.

Here below is the example of the code I'm using at the moment where I trigger the cutscene as soon as I start the game in OpenRoom_2_0 and everytime I re-enter the room, the cutscene is triggered again.

Code: Select all

func OpenRoom_2_0()
{
    ScrRequest(gs_fid("PlayCutscene"));
}
func PlayCutscene()
{
    // position player and avoid eventual jump entries
    PlayerSetPos(580,114);
    PlayerEnterIdle();
    Message0(3,4,"Dizzy has taken \n Daisy on a date");
    Message0(4,5,"to a beautiful place \n with view of a castle"); 
    Message0(5,6,"to ask her \n a special question");MessagePop();
    Message2(5,6,"This is wondeful \n you are so romantic");
    MessagePop();
    Message1(4,5,"I want to ask you something \n Daisy. Would you ...?");
    MessagePop();
    Message2 (5,6,"Ouch"); MessagePop();
    idx = ObjFind(1000); // 
    rand = gs_rand(1);
    if(rand==0)
        ObjSet(idx,O_COLOR,COLOR_GREEN);
    ObjSet(idx,O_TILE,414);
     Message1 (4,5,"Are you ok? \n You suddenly look \n quite ill"); MessagePop();
    Message2 (5,6,"I think I must of \n eaten something bad");     MessagePop();
    Message1 (4,5,"Oh no, I go and find \n you some meds"); MessagePop(); 
   (idx,O_STATUS)==1)

Captain Jonesy
Your Backpack is Empty
Posts: 29
Joined: Mon Feb 15, 2010 12:27 pm

Post by Captain Jonesy » Wed Sep 29, 2010 9:34 pm

I hope that's more clear and easier to understand, sorry for the lack of info before and thanks again for the help. :v2_dizzy_thumbsup:

delta
Hard Boiled Egg
Posts: 3965
Joined: Fri Feb 09, 2007 7:08 pm
Location: North West
Contact:

Post by delta » Wed Sep 29, 2010 9:47 pm

ok yeah, you just need something like this:

Code: Select all

func OpenRoom_2_0()
{
	idx = ObjFind(1000);
	if(ObjGet(idx,O_STATUS)==0)
	{
		PlayCutscene();
	}
}
You don't need the screenrequest code as far as I can see, just call it as a normal function. I'm not even sure what the screenrequest code does differently, if anything.

and then this:

Code: Select all

func PlayCutscene()
{
	// position player and avoid eventual jump entries
	PlayerSetPos(580,114);
	PlayerEnterIdle();

	Message0(3,4,"Dizzy has taken\nDaisy on a date");
	Message0(4,5,"to a beautiful place\nwith views of a castle"); 
	Message0(5,6,"to ask her\na special question"); MessagePop();
	Message2(5,6,"This is wonderful!\nyou are so romantic");
	MessagePop();
	Message1(4,5,"I want to ask\nyou something\nDaisy. Would you...");
	MessagePop();
	Message2 (5,6,"Ouch"); MessagePop();

	idx = ObjFind(1000);
	rand = gs_rand(1);
	if(rand==0)
		ObjSet(idx,O_COLOR,COLOR_GREEN);
	ObjSet(idx,O_TILE,414);

	Message1 (4,5,"Are you ok?\nYou suddenly look\nquite ill"); MessagePop();
	Message2 (5,6,"I think I must have\neaten something bad"); MessagePop();
	Message1 (4,5,"Oh no, I'll go and find\nyou some meds"); MessagePop(); 
	ObjSet(idx,O_STATUS,1);
}
I've written the correct code for you at the bottom. I also corrected some of your grammar in the messages, and removed the spaces before and after \n. The \n is a line break, and you don't need spaces at the start and end of the lines :)
Image

Image

"Quotes from the internet may not be genuine" - Abraham Lincoln

Captain Jonesy
Your Backpack is Empty
Posts: 29
Joined: Mon Feb 15, 2010 12:27 pm

Post by Captain Jonesy » Thu Sep 30, 2010 2:49 pm

Thanks alot Delta - you didn't need to do that with the tweaking of /n code, I need to struggle to learn lol.

I placed your code in my script and tested it and for some reason, the cutscene would get stuck on the 1st speech bubble (wouldn't past the 1st line of dialogue despite pressing all keys), I experimented and tweaked the code little to come up with a solution to this blocker using;

Code: Select all

 func OpenRoom_2_0()
{
    idx = ObjFind(1000);
    if(ObjGet(idx,O_STATUS)==0)
    ScrRequest(gs_fid("PlayCutscene"));
    }
func PlayCutscene()
{ 
I'm not sure why I needed the ScrRequest(gs_fid("PlayCutscene")) code and why the PlayCutscene(); command didn't allow me to continue maybe I needed ObjSet(idx,O_STATUS,1); line just before the 1st line of dialogue to progress but nevertheless, you had the right idea though. I just thought I let you know how it went for future reference. Thanks again :)

Jonesy

delta
Hard Boiled Egg
Posts: 3965
Joined: Fri Feb 09, 2007 7:08 pm
Location: North West
Contact:

Post by delta » Thu Sep 30, 2010 3:43 pm

:v2_dizzy_rolleyes: I should have realised! It was calling the messages from an UpdateRoom function, so of course it won't like getting player input (when the player has to press 'enter' to get through the messages).

That must be what ScrRequest does. It must get around that problem in some way. It may be preferable to use a collider when calling messages, but if it works, then I guess that's all that matters!
Image

Image

"Quotes from the internet may not be genuine" - Abraham Lincoln

Post Reply