function game_start comand [SOLVED]

Started by , Tue 11/01/2005 01:13:46

Previous topic - Next topic

mport2004

i was trying ccs again and i got the error mesages to stop comming up but the ccExecuteCommand wont work.

Scorpiorus

Ok, let's figure out what's wrong...

What do you mean by "ccExecuteCommand wont work"? Doesn't the character move? Does it display some kind of an error message?

What CCS code do you have? And where did you put it?

Try the following code to test:

function game_start() {

   ccDebug(1);
   ccSetBlankView(SOME_BLANK_VIEW_HERE);

   character[PERSON].room = character[GetPlayerCharacter()].room;

   ccCreateCommand(1, "MOVE: 200, 100; MOVE: 100, 100; GOTO:1;");

  ccExecuteCommand(PERSON, 1);
}

Take a look at the debug info when running the game. It tells NPC's room, current CCS action, frame, etc.

mport2004

Wow it worked! :o

i dont know why, i had the ccSetBlankView and the ccCreateCommand and the ccExecuteCommand and the ccDebug

but i dident have the
character[PERSON].room = character[GetPlayerCharacter()].room;
was that why my probraming dident work?

Scorpiorus

Quotebut i dident have the
character[PERSON].room = character[GetPlayerCharacter()].room;
was that why my probraming dident work?
This piece of code places PERSON into the current room. You probably had him in another room (maybe room -1) and thus didn't see his moving.

But do put ccDebug(1) at game_start. This way you should at least see a debug text line shuttling around the room. :)

mport2004

#24
lol ya i put the blank view as a blue cup top see what would happen and there was a blue cup moving in the next room.

thanks for all the help :) :)


um also do you need the spaces before the comands??

TerranRich

Status: Trying to come up with some ideas...

Scorpiorus

Quote from: mport2004 on Fri 14/01/2005 02:24:50
lol ya i put the blank view as a blue cup top see what would happen and there was a blue cup moving in the next room.
Yeah, that's a good idea to use a non-transparent sprite to have some kind of a radar. ;)


As for spaces, as TerranRich has already pointed out, that's not necessarily (but preferable for readability), and in fact in the first versions of the plugin it was required to type a command line with no spaces at all. Currently, the plugin reference also states that you can't have spaces between command parameters but in reality it seems to parse them fine as well.
A colon, however, is a part of the command therefore it's not allowed to separate, say, 'MOVE' and ':'

SMF spam blocked by CleanTalk