NPC not showing up in room?

Started by piraatlife4me, Thu 01/01/2004 19:51:49

Previous topic - Next topic

piraatlife4me

Hey AGS forums,
Hey I have this little problem.  I have this room in my game and I need a npc to be in the room only when I want him to be.  So what I did was I set up a GlobalInt and the command is ready to be called when the integer is set.  The problem is when it is set he still not showing in the room.  Can anyone take a look at this and tell me if anything looks wrong with my room script.  It is really strange but I can't seem to figure out why he is not visible in the room.  This is what I have:
// script for room: Player enters screen (before fadein)
srSetRainAmount(0);
SetObjectIgnoreWalkbehinds (0,4);
FaceLocation(EGO, 150, -1000);
SetGlobalInt(3,1);
SetGlobalInt(13,2);
if (GetGlobalInt(3) ==1) {
character[SKEL].x = 96;
character[SKEL].y = 204;
ReleaseCharacterView(SKEL);
ChangeCharacterView(SKEL,109);
SetCharacterIdle(SKEL, 109, 0);
}  
}
Does this look OK?  Because when I play the game he is not there?

Daniel
Winebarger

Scorpiorus

hello Dan,

Have you set his room? Also, if you are using the CCS plugin make sure the character isn't executing a command when you change his room with character[].room var.

// script for room: Player enters screen (before fadein)
srSetRainAmount(0);
SetObjectIgnoreWalkbehinds (0,4);
FaceLocation(EGO, 150, -1000);
SetGlobalInt(3,1);
SetGlobalInt(13,2);
if (GetGlobalInt(3) ==1) {
ccStopExecution(SKEL); //just in case if he is under CCS control
character[SKEL].room = .....; //now we can safely change his room
character[SKEL].x = 96;
character[SKEL].y = 204;
ReleaseCharacterView(SKEL);
ChangeCharacterView(SKEL,109);
SetCharacterIdle(SKEL, 109, 0);
}
}
SetCharacterIdle(SKEL, 109, 0);
}
}

How works?

piraatlife4me

Hey Scorpius!
It's Dan. Yeah that was it!  All I had to do was stop the execution and it now works the way I want it to! Once again thanks...again!
Really appreciate it!
Daniel
Winebarger


SMF spam blocked by CleanTalk