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


Caravel Forum : DROD Boards : Architecture : Now offering my services as an NPC scripter (No real reason - I just want to do something)
New Topic New Poll Post Reply
Poster Message
joker5
Level: Smitemaster
Rank Points: 607
Registered: 11-25-2003
IP: Logged
icon Now offering my services as an NPC scripter (0)  
This is something of a meager offering - cobbled together in a matter of minutes - but here's my 2 current projects.

One: A programmable "listening" guard - he listens for Beethro's presence in a certain area, and if he detects it he investigates. He's not complete - he just scans the nearest hallway for Beethros, he doesn't actually go to the source of the noise or perform a sweep. That's the next step.

The other is simply a patrolling guard with a visual field. Note that it's a pain to script large, diagonal visual fields so I'm not going to do that. Mostly I'm limiting myself to hallways, rooms and rectangles.

Yeah, that's about it. If you need some work done post here - and give me your hold so I can work on it unless you want to keep having to change all the location values and stuff - if you want secrecy you can go that extra mile but I can't help you there.

Any takers?

~joker5

____________________________
Criminals, like other people, dislike being shot. ~FBI study on guns

www.badgerbadgerbadger.com

"Two words: Beam Waffle!" -me
04-12-2005 at 05:28 AM
View Profile Send Private Message to User Show all user's posts Quote Reply
wackhead_uk
Level: Smiter
Avatar
Rank Points: 352
Registered: 06-21-2004
IP: Logged
icon Re: Now offering my services as an NPC scripter (0)  
You could tell me a way to make it so that the character will do different things depending on where Beethro goes in a room. That is a pain to do.
04-12-2005 at 02:00 PM
View Profile Send Private Message to User Send Email to User Visit Homepage Show all user's posts This architect's holds Quote Reply
joker5
Level: Smitemaster
Rank Points: 607
Registered: 11-25-2003
IP: Logged
icon Re: Now offering my services as an NPC scripter (0)  
Not really - if you don't mind the characters doing the same thing every time Beethro walks into that place. I usually do something like this:

Label "ifcheck"
if (B goes to the left) goto "ForkLeft"
if (B goes to the right) goto "ForkRight"
wait 1 //optional, really, but I don't feel comfortable making infinite loops with no game-time breaks between them.
Goto "ifcheck"
Label "ForkLeft"
do whatever
goto ifcheck
Label "ForkRight"
do whatever2
goto ifcheck

If you want them to only do something ONCE when Beethro enters a room - either A: Get a bunch of invisible characters, one for each variant, and have them appear when Beethro does something, and the first waiting character disappear or B: use doors to store what you already did and add a "if doorclosed then goto ifcheck" thing.

____________________________
Criminals, like other people, dislike being shot. ~FBI study on guns

www.badgerbadgerbadger.com

"Two words: Beam Waffle!" -me
04-12-2005 at 03:30 PM
View Profile Send Private Message to User Show all user's posts Quote Reply
Watcher
Level: Smitemaster
Avatar
Rank Points: 902
Registered: 02-04-2003
IP: Logged
icon Re: Now offering my services as an NPC scripter (+2)  
joker5 wrote:
Label "ifcheck"
 if (B goes to the left) goto "ForkLeft"
 if (B goes to the right) goto "ForkRight"
 wait 1 //optional, really, but I don't feel comfortable making infinite loops with no game-time breaks between them.
 Goto "ifcheck"
Quick point: the wait 1 command is not optional. DROD has a built-in error checker that will stop execution of a script if it gets into an infinite loop without waiting. The exact condition is: if the number of commands executed in a single turn is greater than the number of commands in the entire script, the script will stop and the character will become dormant. This is necessary because execution of a script continues within a single turn until the script hits an actual action, such as wait or move to.

____________________________
Today the refrigerator, tomorrow the world!
04-12-2005 at 03:54 PM
View Profile Send Private Message to User Show all user's posts Quote Reply
joker5
Level: Smitemaster
Rank Points: 607
Registered: 11-25-2003
IP: Logged
icon Re: Now offering my services as an NPC scripter (0)  
Good - I'm not just paranoid then.

And the error checker didn't work for me - it just copies the script. Several times. In test mode. So the character is really messed up.

~joker5

____________________________
Criminals, like other people, dislike being shot. ~FBI study on guns

www.badgerbadgerbadger.com

"Two words: Beam Waffle!" -me
04-12-2005 at 10:03 PM
View Profile Send Private Message to User Show all user's posts Quote Reply
wackhead_uk
Level: Smiter
Avatar
Rank Points: 352
Registered: 06-21-2004
IP: Logged
icon Re: Now offering my services as an NPC scripter (0)  
joker5 wrote:Label "ifcheck"
if (B goes to the left) goto "ForkLeft"
if (B goes to the right) goto "ForkRight"
wait 1 //optional, really, but I don't feel comfortable making infinite loops with no game-time breaks between them.
Goto "ifcheck"
Label "ForkLeft"
do whatever
goto ifcheck
Label "ForkRight"
do whatever2
goto ifcheck

But how do you do that 'B goes to the left'? It doesn't work with a wait command and I can't get any other way of doing this without adding monsters where they are and doing scripted commands based on which monsters he kills. I suppose I want to be able to do something a bit like KDD L25.
04-13-2005 at 11:40 PM
View Profile Send Private Message to User Send Email to User Visit Homepage Show all user's posts This architect's holds Quote Reply
Watcher
Level: Smitemaster
Avatar
Rank Points: 902
Registered: 02-04-2003
IP: Logged
icon Re: Now offering my services as an NPC scripter (+1)  
wackhead_uk wrote:
But how do you do that 'B goes to the left'? It doesn't work with a wait command and I can't get any other way of doing this without adding monsters where they are and doing scripted commands based on which monsters he kills. I suppose I want to be able to do something a bit like KDD L25.
Actually, a Wait command is exactly what you need. When placed directly after If statements, Wait commands work as conditionals. Instead of actually waiting for something to happen, the script will check whether it's true. If it is, the script will jump to somewhere else, and if it isn't, it'll continue downwards. Here's what Joker's script should look like in the editor:
Label "ifcheck"
 if ... goto "ForkLeft"
 Wait for player at <left area>
 if ... goto "ForkRight"
 Wait for player at <right area>
 wait 1
 Goto "ifcheck"
Label "ForkLeft"
 <do whatever>
 goto ifcheck
Label "ForkRight"
 <do whatever2>
 goto ifcheck


This will repeatedly check whether Beethro is in one of the two areas, and if he is, perform the appropriate commands.

____________________________
Today the refrigerator, tomorrow the world!
04-13-2005 at 11:58 PM
View Profile Send Private Message to User Show all user's posts Quote Reply
wackhead_uk
Level: Smiter
Avatar
Rank Points: 352
Registered: 06-21-2004
IP: Logged
icon Re: Now offering my services as an NPC scripter (0)  
I found out what not making it work last time - if you tell the character to go somewhere and he can't get there, he stop responding until you make a path for him to get there and he reaches his destination.
04-14-2005 at 01:27 PM
View Profile Send Private Message to User Send Email to User Visit Homepage Show all user's posts This architect's holds Quote Reply
New Topic New Poll Post Reply
Caravel Forum : DROD Boards : Architecture : Now offering my services as an NPC scripter (No real reason - I just want to do something)
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.