Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: mport2004 on Tue 18/01/2005 17:43:48

Title: a ccs problem characters in wrong room
Post by: mport2004 on Tue 18/01/2005 17:43:48
when i start my game the character that is ment to be in another room (room15) is in the starting room and i dont know why i set him to be in room 15.

the script


function game_start() {

Ã,  Ã, ccDebug(1);
Ã,  Ã, ccSetBlankView(5);

Ã,  Ã, character[MAN].room = character[GetPlayerCharacter()].room;
Ã,  Ã, character[MANB].room = character[GetPlayerCharacter()].room;

ccCreateCommand(1, "MOVE: 250, 120; MOVE: 305, 113; ROOM: 4,13,100; MOVE: 155,112; MOVE: 155,182; MOVE: 10,184; ROOM: 3,300,183; MOVE: 100, 110; GOTO:1;");
ccExecuteCommand(EAT, 1);
ccCreateCommand(2, "MOVE: 220, 145; MOVE: 90, 145; GOTO:2;");
ccExecuteCommand(RIVERGARD, 2);
}


does it have something to do with the character
[MANB].room = character[GetPlayerCharacter()].room;
command?
Title: Re: a ccs problem characters in wrong room
Post by: Scorpiorus on Tue 18/01/2005 18:26:18
Yeah, comment out these two lines

   character[MAN].room = character[GetPlayerCharacter()].room;
   character[MANB].room = character[GetPlayerCharacter()].room;
Title: Re: a ccs problem characters in wrong room
Post by: mport2004 on Tue 18/01/2005 18:38:14
comment?
Title: Re: a ccs problem characters in wrong room
Post by: Scorpiorus on Tue 18/01/2005 18:39:25
Or in other words remove ;)
Title: Re: a ccs problem characters in wrong room
Post by: mport2004 on Tue 18/01/2005 18:43:38
i did

it seems to work.
i also had another problem

MANB keeps stalling and the commands in the debug view start to flicker very fast and he dosent move.
Title: Re: a ccs problem characters in wrong room
Post by: Scorpiorus on Tue 18/01/2005 18:50:46
QuoteMANB keeps stalling and the commands in the debug view start to flicker very fast and he dosent move.
What command line did you order him to execute? And where did you place the appropriate ccExecuteCommand(MANB, ? ? ?) function?
Title: Re: a ccs problem characters in wrong room
Post by: mport2004 on Wed 19/01/2005 02:57:10
ccCreateCommand(2, "MOVE: 220, 145; MOVE: 90, 145; GOTO:2;");
ccExecuteCommand(RIVERGARD, 2);


(MANB is RIVERGARD)
Title: Re: a ccs problem characters in wrong room
Post by: TerranRich on Wed 19/01/2005 02:59:07
On a sidenote, mport2004, to "comment out" a line means to add // to the beginning of the lines. It is called a comment in scripting jargon and will make AGS ignore those lines. It's preferable to deleting them, because you might need them again later, or it's useful as a way of narrowing down the problems.
Title: Re: a ccs problem characters in wrong room
Post by: strazer on Wed 19/01/2005 03:03:13
ccCreateCommand(2, "MOVE: 220, 145; MOVE: 90, 145; GOTO:2;");
                                      ^--- goes here ---|

You probably want him to go to the first command in that chain, so do GOTO:1;

You can also comment out whole blocks of text like this:

/*
This whole
section
will be
commented out.
*/