Path: chuka.playstation.co.uk!scea!peter_alau@playstation.sony.com From: Darco Newsgroups: scee.yaroze.freetalk.english Subject: NPC Scripting, Re: An adventure project Date: Mon, 07 Jun 1999 20:20:30 -0400 Organization: SCEA News Server Lines: 108 Message-ID: <375C61CE.2183A46D@boone.net> References: <3759079a.1869875@www.netyaroze-europe.com> Reply-To: darco@bigfoot.com NNTP-Posting-Host: 216.88.25.169 Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Mailer: Mozilla 4.05 [en] (Win95; U) Barry & Robert Swan wrote: > > ok, ok yet another 'I want to do such and such a project and am > looking for help...' Kick Ars. > * V important: some sort of scripting for the NPCs - to allow > them to act normally under their own steam, and interact in a passably > intelligent manner with the player. A while back I wrote a fairly nifty scripting language for NPC's. Wrote a compiler, and even an emulator. It was never incorporated into a finished game, but it was fairly nifty being my first dabble into virtual machine programming. You could code small loops stuff into it -- make it even ask questions and check for items and such. The code is fairly small. The scripting code looked like this: ###### START OF SCRIPT FILE ######## RSL #Burnt down town #First sign post at main entrance to town ^NPC 1 Welcome to Alegville!~PAU~END ^XXX #Some guy lying on the ground ^NPC 2 .~WAT1.~WAT1.~WAT1 No pulse.~PAU~END ^XXX #Dude who eventually joins our main character ^NPC 3 SOLDIER~NXT"Go away"~PAU~END ^XXX #Sign in front of big house ^NPC 4 Home Sweet Home~PAU~END ^XXX #Some old geezer on the path who is alive ^NPC 5 OLD MAN~NXT"They~WAT1 came in the night;~WAT1 and killed .~WAT1.~WAT1.~WAT1 my wife. I have nothing left!~WAT1 What do I have to live for?"~PAU~END ^XXX ###### END OF SCRIPT FILE ######## As you see, you'd have one of these files for each level - each NPC would follow the program. I wrote a compiler for it as well. Here is a full listing of the command codes: RSL v.1 Command set -=-=-=-=-=-=-=-=-=- b=byte w=word ?=not net decided on ^NPC NpcNumber(b) - Signifies the start of RSL Script ^XXX - Signifies the end of RSL Script ~ANM AnimeNumber(b) - Play NPC anime sequence ~WAT Seconds(b) - Wait specified seconds ~PAU - Pause for button ~YON - Yes Or No query ~IFS (b) - If bit(s) Set ~EOB - End Of Block ~CUT CutSceneNumber(?) - Play a cutscene number ~NXT - Force next line ~END - End execution ~GIV ItemNumber(b) - Gives player item ~TAK ItemNumber(b) - Takes item away from player ~SEN SenerioName - Loads a scenerio ~SET (b) - Sets a variable Byte Values -=-=-=-=-=- ^NPC - 7Fh ^XXX - 80h ~ANM - 81h ~WAT - 82h ~PAU - 83h ~YON - 84h ~IFS - 85h ~EOB - 86h ~CUT - 87h ~NXT - 88h ~GIV - 89h ~END - 8Ah ~TAK - 8Bh ~SEN - 8Ch ~SET - 8Dh I honestly thought that all of this was pretty nifty myself when I wrote it 2 years ago. With a little bit of dusting, it just might suit your needs. While it's not the most powerful way to do things, it is simple, which is all that really matters in a project like this, right? And all of the major code has been written... If you are intertested, reply and I'll upload all of the stuff you need onto the net so you can take a closer look. I also have a visual level editor that could be quickly re-written to work for an RPG game, but it's not isometric. Sorry. 'Darco