Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting > NPC Server
FAQ Members List Calendar Today's Posts

 
 
Thread Tools Search this Thread Rate Thread Display Modes
  #1  
Old 09-29-2002, 04:32 AM
R0b1n-NPC R0b1n-NPC is offline
Registered User
Join Date: Sep 2002
Posts: 397
R0b1n-NPC is on a distinguished road
canwarp2

ok here is my script:

NPC Code:

// NPC Made by R0bin
if (created) {
showcharacter;
setstring this.bird,2;
setcharani nickpet_walk#s(this.bird),;
this.speed = 0.2;
canwarp2;
move();
}
function move() {
this.dircounter++;
if (this.dircounter>100) {
this.dircounter=0;
this.rando1=int(random(0,2));
dir = (dir+1+this.rando1*2)%4;
}
x=x+vecx(dir)*this.speed;
y=y+vecy(dir)*this.speed;
sleep 0.1;
move();
}



and here is my problem:

When the bird gets to the edge of the level, it just stays there and does nothing. why?

(yes the map is set properly)
__________________
- R0bin
  #2  
Old 09-29-2002, 04:36 AM
Graal2001_Developer1 Graal2001_Developer1 is offline
Registered User
Join Date: Sep 2002
Location: Germany - Lübeck
Posts: 17
Graal2001_Developer1 is on a distinguished road
Send a message via ICQ to Graal2001_Developer1
are you sure recursive functions work in the next level?
I think the loop stops here so it doesn't move any further but I'm not sure...
__________________
This is TDO
Nothing to say.. just need a webhost for images
  #3  
Old 09-29-2002, 04:44 AM
R0b1n-NPC R0b1n-NPC is offline
Registered User
Join Date: Sep 2002
Posts: 397
R0b1n-NPC is on a distinguished road
I tried it with a timeout also.
But to no avail.
__________________
- R0bin
  #4  
Old 09-29-2002, 10:33 PM
R0b1n-NPC R0b1n-NPC is offline
Registered User
Join Date: Sep 2002
Posts: 397
R0b1n-NPC is on a distinguished road
Riot suggested that, but it didnt warp around for me. rudora npc server just blows.
__________________
- R0bin
  #5  
Old 09-29-2002, 11:31 PM
CheeToS2 CheeToS2 is offline
That Guy
CheeToS2's Avatar
Join Date: Dec 2001
Location: Seattle, WA
Posts: 2,528
CheeToS2 will become famous soon enough
Send a message via AIM to CheeToS2
Did you bother going into the level it was headed towards? :P

Theres a canwarp2 bug where.. when the npc goes to a different level, the people who were in the level it moved from still see it at the edge of the level until they go to the new level it went to.
__________________

  #6  
Old 09-30-2002, 03:20 AM
R0b1n-NPC R0b1n-NPC is offline
Registered User
Join Date: Sep 2002
Posts: 397
R0b1n-NPC is on a distinguished road
yes i did, and i was monitoring it on the npc server as well and it stayed in the same level for about 30 mins without the x or y changing. :-P
__________________
- R0bin
  #7  
Old 10-02-2002, 11:11 PM
emortylone emortylone is offline
Registered User
Join Date: Apr 2002
Location: Control-NPC
Posts: 834
emortylone is on a distinguished road
If I'm not mistaken, Canwarp2 is for moving inside levels that aren't on the map. Canwarp though is for regular outside levels?? I haven't used it in a while, but I believe I'm correct in this assumption? You can always have it warp once it gets to another level. I'm sure it is, but just for the obvios, it's a Database NPC correct?
---Shifter
__________________
Quote:
*Stefan: it seems sometimes they hire newbie scripters everywhere x-x
*Stefan: scripters are sometimes like people that draw paintings
*Stefan: all that counts is that it looks nice
  #8  
Old 10-03-2002, 04:40 AM
R0b1n-NPC R0b1n-NPC is offline
Registered User
Join Date: Sep 2002
Posts: 397
R0b1n-NPC is on a distinguished road
Correct.

I assume because of rudora's wierd level nameing (rudora_5,2.graal etc.)

So i had to make my own function x.x
__________________
- R0bin
  #9  
Old 10-03-2002, 10:52 AM
Com013 Com013 is offline
Registered User
Join Date: Aug 2002
Location: GMT+1
Posts: 381
Com013 is on a distinguished road
Quote:
canwarp is for npcs which already know the way
and want to be warped exactly like a player
(good when you use the waytracker item for
recording a way for police npcs or so);
Quote:
canwarp2 is for overworld npcs which move
randomly, so this is using the normal links
and check for onwall on the destination level,
it also doesn't let the npc go into small
links (houses)
And I really wouldn't do it recursive, and you should use move to make things look less laggy.
__________________
Com013
Former Admin of the LAT on Graal The Adventure

e-mail: [email protected]
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 01:24 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.