Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: piraatlife4me on Thu 01/01/2004 19:51:49

Title: NPC not showing up in room?
Post by: piraatlife4me on Thu 01/01/2004 19:51:49
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
Title: Re:NPC not showing up in room?
Post by: Scorpiorus on Thu 01/01/2004 20:00:49
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?
Title: Re:NPC not showing up in room?
Post by: piraatlife4me on Thu 01/01/2004 21:39:00
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