First Screen woes

Started by sentient, Sun 16/05/2004 00:06:59

Previous topic - Next topic

sentient

I want to do a animation when I first enter a screen,which only plays the first time. I haven't sussed this scripting system out at all yet. How do I achieve this sort of thing? For example the thing I want is two characters running, one chasing the other. When the second character reaches you it begins a conversation with you. I don't want a dialogue at this point just an automatic reply.

This sounds very complicated to me at the mo. Is it very difficult? I have far worse things lined up for later in the game( as in much more comlicated scenes, involving 8 or more characters/objects at one time). I have read the basic scripting tutorial, but it doesn't really talk about movement and character interaction at all.

I assume I use the startcutscene command? I'm not sure if I need this or not.
Any ideas of where I can look for help at all?

Ashen

QuoteAny ideas of where I can look for help at all?
The manual ;)

Specificly, you might want to look up:
MoveCharacter,
MoveCharacterPath,
MoveObject (maybe),
DisplaySpeech,
StartCutscene / EndCutscene (if you want it to be skipable).

Hope this helps.
I know what you're thinking ... Don't think that.

Scorpiorus

That may be a good chance to fall into the scripting stuff :)

Interactions - First time player enters screen - RunScript:


// script for room: First time player enters screen



Ã,  // start the cutscene (2 means it can be skipped by pressing any key):

   StartCutscene(2);

Ã,  // setting EGO position (outside of the screen):

   character[EGO].x = -50;
   character[EGO].y = 100;

Ã,  // setting MAN position (outside of the screen):

   character[MAN].x = -100;
   character[MAN].y = -100;

Ã,  // setting EGO & MAN walking speeds (MAN faster than EGO):

   SetCharacterSpeed(EGO, 3);
   SetCharacterSpeed(MAN, 5);

Ã,  // they start running (ingnoring walkable areas):

   MoveCharacterDirect(EGO, 250, 100);
   MoveCharacterDirect(MAN, 230, 100);

Ã,  // wait until EGO stops:

   while (chatacter[EGO].walking) Wait(1);

Ã,  // display conversation:

   DisplaySpeech(MAN, "Caught you!11!");
   DisplaySpeech(EGO, "Please... Don't hurt me!");

Ã,  // mark the end of cutscene:

   EndCutscene();

sentient

That looks like the sort of thing I need.

I have got the basic thing done with normal commands like move character etc. The only problem I have had is. I move the characters to say, room2 and there is no position character option so it is random where they will turn out.

The script you have sent me, looks useful, but I have found using the move character options easier to use as it uses the walk areas automatically. So I can get the scene I need without even using a script.

Of course there is the problem of positioning my character after running these auto lines. I'll tell you now that the character is watching these two characters run. He isn't a participant.

I need to know how scripting works, but the editor seems to have a lot of options available without the need to script. Is there a command to position characters automatically?

Thanks Scorpiorus, you seem to have a good knowledge of  AGS, any tips on basic scripting techniques would be appreciated. Eg, hiding characters during scripts would be useful. ( If it is possible of course)

Thanks for your help. I will probably need it again soon!

Scorpiorus

#4
Quote from: sentient on Sun 16/05/2004 02:50:58I move the characters to say, room2 and there is no position character option so it is random where they will turn out.
Yes, there is no one. That's when using of script comes in handy. If you've noticed, the equivalent of moving NPC to another room is: character[NPC].room = <number here>;
So you can have:

StopMoving(NPC);
character[NPC].room = 2;
character[NPC].x = 100;
character[NPC].y = 200;

StopMoving is necessary in case the character is currently moving (you mustn't change his position while he is moving).

QuoteThe script you have sent me, looks useful, but I have found using the move character options easier to use as it uses the walk areas automatically. So I can get the scene I need without even using a script.
There is a function MoveCharacter(). It does take into account walkable areas. The reason I used MoveCharacterDirect() is that he walks in from the outside of the screen and there are no walkable areas there.

QuoteOf course there is the problem of positioning my character after running these auto lines. I'll tell you now that the character is watching these two characters run. He isn't a participant.
Well, you can replace EGO with any other script name you want.

QuoteI need to know how scripting works, but the editor seems to have a lot of options available without the need to script. Is there a command to position characters automatically?
As I meantioned above use character[NPC].x and character[NPC].y variables.

QuoteThanks Scorpiorus, you seem to have a good knowledge ofÃ,  AGS, any tips on basic scripting techniques would be appreciated. Eg, hiding characters during scripts would be useful. ( If it is possible of course)
Simply move him to room -1.

character[NPC].room = -1;

SMF spam blocked by CleanTalk