A redesign of the AGS site is now ready to be implemented! Please help us with art and content.

Author Topic: Scripting Help or Module Help / You Decide .  (Read 826 times)

Scripting Help or Module Help / You Decide .
« on: 14 Jan 2011, 21:44 »
Hi everyone , i'm having some problems with NPC's and i need the code to be fixed. I need npc to walk in different rooms randomly. For example npcs 1 is gonna start in room2 and walk to the right edge of the room2 and go to room3 then maybe while he was moving to the right edge of the room2 the npc in the room3 is gonna come to the room2 i mean i want to do this , so i simply tried this to move the cKiz character to the right edge , and then make it start from the again left edge of the room and it will seem like it went off the room from right edge and another character came from the left edge of the room or sumthing like that ; ( AND ALSO THERE IS ANOTHER CHARACTERS MOVE IN THE ROOM BUT FIRST I TRIED TO TRY THE FUNCTION ON cKiz CHARACTER  ) PS : none of the characters in the code i give you is our main character , our character just stands on the bottom of the room while those functions working

function room_FirstLoad()
cKiz.Walk(1905, 538, eNoBlock);
cErkekFig.Walk(22, 565, eNoBlock);
cFi2.Walk(22, 565, eNoBlock);

function room_RepExec()
if (cKiz.x > 1000) {
  eShadow.Disable(cKiz); // about shadow module
  cKiz.ChangeView(6); // the view which has no image i mean empty transparant thing
  cKiz.StopMoving(); // For the code which i use after this
  cKiz.SetWalkSpeed(50,50); // I wrote this , because i want player to think when the character went to the right edge it went to the different room , the next room , but actually , it's just gonna be invisible and start from the left edge of the room again like another npc , and it needs to move very fast , if there is any teleport script i know , i would use it  :D .
  cKiz.Walk(113,494,eNoBlock); //  the invisible cKiz character walks to the left edge very fast while the player thinks it went to other room
  cKiz.FaceLocation(1000,1000); //  the invisible cKiz character turns her face to right of the room so when it's visible again the player assume that another player come from the left edge.
  cKiz.ChangeView(10); // Her own view
 cKiz.Walk(1905, 538, eNoBlock);

else if (cFi2.x < 18 ) {
cFi2.ChangeRoom(-1, 0, 0); }

else if (cErkekFig.x < 18) {
  cErkekFig.ChangeRoom(-1, 0, 0);
gGos.Visible = false;


But after i tried this the character went to right edge and the shadow was invisible and the character was doing nothing also the other characters stopped their function too.

Actually , the thing i want is the just the same thing with the Character Control Module ( http://www.adventuregamestudio.co.uk/yabb/index.php?topic=28821.0 ) but i could't make it work in AGS 3.2.1 beta i'm working with AGS 3.2.1 beta .

Is there anyone who can solve my script problem or who says " it 'll be very very better for you to use Character Control Script to move the NPC's in different rooms and i will show you how to use that script because i think when you import CharacterControl_085 it says you need the older versions of this script and i think you don't know which one you should download and import to AGS 3.2.1 beta and don't know how to use it in the rooms , don't worry i will tell you all , now let's start with ....... "

I'm open to every suggestion :D .
« Last Edit: 15 Jan 2011, 12:19 by T-Pr »