Announcement: Why not try our official idea generator for inspiration when making puzzles?


Caravel Forum : DROD Boards : Architecture : Script Question?
New Topic New Poll Post Reply
Poster Message
Jeff_Ray...
Level: Smitemaster
Avatar
Rank Points: 962
Registered: 05-16-2005
IP: Logged
icon Script Question? (0)  
Alright, so I want to have a NPC follow the player, but then, when the player arrives somewhere, it stops following the player.

How do I do this?

____________________________
I make Let's Plays too!
Click here to find out my LPs' progress, and find out what I plan to tackle next!

Currently playing:
Click here to view the secret text


My Holds:
-Completed:
Click here to view the secret text

-Work in Progress:
Click here to view the secret text

04-21-2007 at 04:15 PM
View Profile Send Private Message to User Send Email to User Show all user's posts High Scores This architect's holds Quote Reply
The Ripen
Level: Roachling
Rank Points: 10
Registered: 04-09-2007
IP: Logged
icon Re: Script Question? (0)  
It is quite easy.

If you want to make a NPC following the player all the time:
1. Make a label.
2. Make the NPC move to player's positon.
3. Make the whole script jump to the 1st label.

Label "follow"
Move to Player
Go to "follow"

____________________________
The 8-Bit necromacer
04-21-2007 at 04:21 PM
View Profile Send Private Message to User Show all user's posts Quote Reply
Jeff_Ray...
Level: Smitemaster
Avatar
Rank Points: 962
Registered: 05-16-2005
IP: Logged
icon Re: Script Question? (0)  
I know this, but I want it to stop when the player is at a place.

____________________________
I make Let's Plays too!
Click here to find out my LPs' progress, and find out what I plan to tackle next!

Currently playing:
Click here to view the secret text


My Holds:
-Completed:
Click here to view the secret text

-Work in Progress:
Click here to view the secret text

04-21-2007 at 04:42 PM
View Profile Send Private Message to User Send Email to User Show all user's posts High Scores This architect's holds Quote Reply
Ravon
Level: Master Delver
Avatar
Rank Points: 220
Registered: 02-19-2004
IP: Logged
icon Re: Script Question? (+1)  
Label loop
  Move to Player 0,1
  If ... 
        Wait for entity Player 16,25,21,30
     End 
  Else 
     Go to loop

Single step is your friend... (and what you should choose for the move to player command)

[Last edited by Ravon at 04-21-2007 04:46 PM]
04-21-2007 at 04:46 PM
View Profile Send Private Message to User Send Email to User Show all user's posts This architect's holds Quote Reply
The Ripen
Level: Roachling
Rank Points: 10
Registered: 04-09-2007
IP: Logged

File: Follow.hold (1.3 KB)
Downloaded 46 times.
License: Public Domain
icon Re: Script Question? (0)  
This one is made with a varaible.
<-- example

[1st npc]
label "follow"
 if ...
      wait until var (your varaible) = 1
    Move (0,0)
 else
    Move to Player    Single step
 if End
 Go to "follow"

[2nd npc] invissible
 Wait for entity Player at (xx,yy)-(xx,yy)
 Set var (your variable) = 1


____________________________
The 8-Bit necromacer

[Last edited by The Ripen at 04-21-2007 04:59 PM]
04-21-2007 at 04:50 PM
View Profile Send Private Message to User Show all user's posts Quote Reply
New Topic New Poll Post Reply
Caravel Forum : DROD Boards : Architecture : Script Question?
Surf To:


Forum Rules:
Can I post a new topic? No
Can I reply? No
Can I read? Yes
HTML Enabled? No
UBBC Enabled? Yes
Words Filter Enable? No

Contact Us | CaravelGames.com

Powered by: tForum tForumHacks Edition b0.98.9
Originally created by Toan Huynh (Copyright © 2000)
Enhanced by the tForumHacks team and the Caravel team.