⌂ YolkfolkThe Dizzy Fansite
Community discussion

Newbie trigger animated object question

Started by Captain Jonesy on 29 September 2010 • 4,023 views

9 posts
#54810
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
👍 0
#71761
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 Video Tutorials to see how to do the waypoint for the Bat.
👍 0
#71763
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
👍 0
#71764
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 :smile: 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! :smile:
👍 0
#71765

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.

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)

 

👍 0
#71766
I hope that's more clear and easier to understand, sorry for the lack of info before and thanks again for the help. {yolkfolk}:thumb:
👍 0
#71768

ok yeah, you just need something like this:

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:

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

	Message0(3,4,"Dizzy has takennDaisy on a date");
	Message0(4,5,"to a beautiful placenwith views of a castle"); 
	Message0(5,6,"to ask herna special question"); MessagePop();
	Message2(5,6,"This is wonderful!nyou are so romantic");
	MessagePop();
	Message1(4,5,"I want to asknyou somethingnDaisy. 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 looknquite ill"); MessagePop();
	Message2 (5,6,"I think I must haveneaten something bad"); MessagePop();
	Message1 (4,5,"Oh no, I'll go and findnyou 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 :smile:

👍 0
#71769

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;

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 :smile:

Jonesy

👍 0
#71770
{yolkfolk}:rollseyes: 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!
👍 0