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


Caravel Forum : DROD Boards : Architecture : Scripting reference guide (For character scripting in 2.0)
Page 1 of 2
2
New Topic New Poll Post Reply
Poster Message
schep
Level: Smitemaster
Avatar
Rank Points: 865
Registered: 03-01-2005
IP: Logged
icon Scripting reference guide (+5)  
Announcing the unofficial, comprehensive DROD 2.0 Character Scripting Reference Guide, now available at
http://www.msu.edu/~schepler/DRODScriptRef.txt

There you will find all you ever wanted to know and more about exactly what any DROD 2.0 character script will do under any circumstances. The document goes into much deeper detail than the in-game help. It is not intended as a tutorial or introduction to scripting. Reading it in order to learn to write scripts would be something like learning C++ by reading the ANSI/ISO standard. Well, maybe a bit better than that.

Please feel free to post or PM any inaccurate information, omissions or corrections, point out any unclear wording, etc. In addition, if anybody with an official Caravel voice wants to point out behaviors documented here that are in fact bugs, or situations that have "undefined" results where we shouldn't rely on current behavior in case it changes arbitrarily in the future, I'll try to modify it to reflect those.

I might try an HTML version at some point, but it wouldn't be extremely spiffy.

[Edited by schep at Local Time:06-03-2005 at 11:39 PM: fix url tag]

[Last edited by mrimer at 05-08-2006 10:41 PM]
06-03-2005 at 11:38 PM
View Profile Send Private Message to User Send Email to User Show all user's posts This architect's holds Quote Reply
eytanz
Level: Smitemaster
Avatar
Rank Points: 2708
Registered: 02-05-2003
IP: Logged
icon Re: Scripting reference guide (0)  
Cool! I didn't quite understand the "wait for event" section, but this seems like a very valuable resource.

____________________________
I got my avatar back! Yay!
06-04-2005 at 12:31 AM
View Profile Send Private Message to User Show all user's posts This architect's holds Quote Reply
mrimer
Level: Legendary Smitemaster
Avatar
Rank Points: 5056
Registered: 02-04-2003
IP: Logged
icon Re: Scripting reference guide (+1)  
Wonderful work! Thank you for taking the time to write this up. :thumbsup

Some fixes:
Script commands are documented in script.html, not commands.html.

Face direction: Always takes exactly one turn, even if the character is invisible, or already facing the specified direction. (This is a bug I'm fixing in 2.0.8 -- neither of these situations should halt the script, i.e. they should act as [Free].)

Appear/appear at/disappear: If the character is already visible or has no appearance type, the command has no effect and counts as a Free command. (This isn't true for Appear/Appear at -- they both act as disappear, which [Restrict]s. However, this is a bug to be fixed in 2.0.8: they should act as [Restrict] when changing visibility, otherwise [Free].)

Speech: ...or estimated as 50 milliseconds per character... (This should be 1s + 50ms/char. Additionally, here's a non-documented behavior: if subtitles are set to not be displayed when a sound clip is playing, and if a speech's delay is set to 1ms, the text is not shown even when w/o an attached sound clip. This is not a bug -- it's a special case used to split text onto two or more lines when it's too long to fit on one, but better to have a single sound clip for the entire bit, in which case, the text shouldn't show for the rogue lines.)

Set Music: (It's probably useful to mention that if, on room entrance, music is set to the type playing when the last room was exited, then that music will continue playing uninterrupted.)

I'd replace "swordsman" with "player" everywhere (for future maintenance).

"but start its script with" --> "might start its script with"

____________________________
Gandalf? Yes... That's what they used to call me.
Gandalf the Grey. That was my name.
I am Gandalf the White.
And I come back to you now at the turn of the tide.
06-05-2005 at 04:26 AM
View Profile Send Private Message to User Send Email to User Show all user's posts High Scores This architect's holds Quote Reply
schep
Level: Smitemaster
Avatar
Rank Points: 865
Registered: 03-01-2005
IP: Logged
icon Re: Scripting reference guide (0)  
mrimer wrote:
Some fixes:
Fixed. (As before, 2.0.8 behavior is in the main text. The list of 2.0.7 bugs in the last section has grown.)

I vaguely thought that "player" means the person watching the screen and pressing keys, while "swordsman" means the ugly man in a yellow shirt, named Beethro or Tolbus or whatever, hacking through the holds. That idea has obvious problems, since the software doesn't agree with command names like "Wait while player is", and I certainly didn't use the terms very consistently either. The tricky part to fixing that stuff up will be when to use gender-inclusive language. I'll figure it out later.
06-06-2005 at 02:49 AM
View Profile Send Private Message to User Send Email to User Show all user's posts This architect's holds Quote Reply
mrimer
Level: Legendary Smitemaster
Avatar
Rank Points: 5056
Registered: 02-04-2003
IP: Logged
icon Re: Scripting reference guide (0)  
schep wrote:
I vaguely thought that "player" means the person watching the screen and pressing keys, while "swordsman" means the ugly man in a yellow shirt, named Beethro or Tolbus or whatever, hacking through the holds.
Yes, this is one way to think of it. Maybe "hero" is a less confusing word. However, swordsman will work for now.

____________________________
Gandalf? Yes... That's what they used to call me.
Gandalf the Grey. That was my name.
I am Gandalf the White.
And I come back to you now at the turn of the tide.
06-06-2005 at 04:01 AM
View Profile Send Private Message to User Send Email to User Show all user's posts High Scores This architect's holds Quote Reply
schep
Level: Smitemaster
Avatar
Rank Points: 865
Registered: 03-01-2005
IP: Logged
icon Re: Scripting reference guide (+5)  
Posted a new version.

Mostly it's just minor tweaks and updates for 2.0.8/2.0.9. I did add a chart of the order of event phases, since that particular paragraph is a slight mess. The player/swordsman issues are still messed up, so maybe I won't figure it out later.

08-28-2005 at 10:30 PM
View Profile Send Private Message to User Send Email to User Show all user's posts This architect's holds Quote Reply
mrimer
Level: Legendary Smitemaster
Avatar
Rank Points: 5056
Registered: 02-04-2003
IP: Logged
icon Adding new event check scripting (+1)  
FYI: I'm adding an NPC scripting event check for the player swinging his sword. Currently, it can be done by using two "Wait for player to face <clockwise>" and "...<counter-clockwise>" checks, but in 2.0.11 this check will be possible with a single query command "Wait for event <player swings sword>".

____________________________
Gandalf? Yes... That's what they used to call me.
Gandalf the Grey. That was my name.
I am Gandalf the White.
And I come back to you now at the turn of the tide.
10-07-2005 at 08:18 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
mrimer
Level: Legendary Smitemaster
Avatar
Rank Points: 5056
Registered: 02-04-2003
IP: Logged
icon Re: Scripting reference guide (0)  
silver found a typo in the scripting guide, where it says
When it is convenient to use one sound file and two caption lines, setting the second Speech command to 1 ms with no sound file will be useful.
Second should read first.

____________________________
Gandalf? Yes... That's what they used to call me.
Gandalf the Grey. That was my name.
I am Gandalf the White.
And I come back to you now at the turn of the tide.

[Last edited by mrimer at 06-23-2006 02:43 PM]
06-23-2006 at 02:43 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
schep
Level: Smitemaster
Avatar
Rank Points: 865
Registered: 03-01-2005
IP: Logged
icon Re: Scripting reference guide (+1)  
mrimer wrote:
silver found a typo in the scripting
You mean thinko. Fixed. And this reminds me to look into those 2.0.11 changes you mentioned.

06-23-2006 at 05:15 PM
View Profile Send Private Message to User Send Email to User Show all user's posts This architect's holds Quote Reply
schep
Level: Smitemaster
Avatar
Rank Points: 865
Registered: 03-01-2005
IP: Logged
icon Re: Scripting reference guide (+1)  
Oh yeah, 2.0.11 announcement. Isn't that update timely.

With better timing, updated for 2.0.15. In particular, described the new behavior of "Wait 0 turn(s)". Also a minor edit for the thing about stabbing golems. And now that the editor won't allow duplicate labels, I removed the part explaining that they're just a bad idea.

The link again.

Can I get clarification on whether I explained the Strike Orb At issue correctly? It looks like there's no change in script execution between 2.0.8 and 2.0.15, we're just warned that if there's no orb at the square, 3.* will act differently.

[Last edited by schep at 02-27-2007 02:18 AM]
02-27-2007 at 02:09 AM
View Profile Send Private Message to User Send Email to User Show all user's posts This architect's holds Quote Reply
mrimer
Level: Legendary Smitemaster
Avatar
Rank Points: 5056
Registered: 02-04-2003
IP: Logged
icon Re: Scripting reference guide (+1)  
schep wrote:
Can I get clarification on whether I explained the Strike Orb At issue correctly? It looks like there's no change in script execution between 2.0.8 and 2.0.15, we're just warned that if there's no orb at the square, 3.* will act differently.
That's right -- 2.0.15 hasn't changed how this script command is handled. The change will be in 3.*

Mike

____________________________
Gandalf? Yes... That's what they used to call me.
Gandalf the Grey. That was my name.
I am Gandalf the White.
And I come back to you now at the turn of the tide.
02-27-2007 at 05:37 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
Casebier
Level: Master Delver
Avatar
Rank Points: 283
Registered: 08-03-2005
IP: Logged
icon Re: Scripting reference guide (0)  
So how soon before DROD 3.0 stuff is documented? I'm trying to get an NPC to construct a bridge, but the only thing it does is make the area show the bridge fading in and out.

I'm also trying to figure out what the two new things eyes are supposed to be able to do, but I can't find anything new, unless the mirrors are one of those things.

____________________________
Casebier
--------------------------------
Revisiting old Project: ZelDROD 1 / ZelDROD RPG (If I can ever find the custom graphic files that I made for it.)
04-03-2007 at 05:29 AM
View Profile Send Private Message to User Show all user's posts Quote Reply
coppro
Level: Smitemaster
Rank Points: 1308
Registered: 11-24-2005
IP: Logged
icon Re: Scripting reference guide (+1)  
Casebier wrote:
So how soon before DROD 3.0 stuff is documented? I'm trying to get an NPC to construct a bridge, but the only thing it does is make the area show the bridge fading in and out.

I'm also trying to figure out what the two new things eyes are supposed to be able to do, but I can't find anything new, unless the mirrors are one of those things.


Warning: spoilers:

Click here to view the secret text


Click here to view the secret text

04-03-2007 at 05:50 AM
View Profile Show all user's posts Quote Reply
schep
Level: Smitemaster
Avatar
Rank Points: 865
Registered: 03-01-2005
IP: Logged
icon Re: Scripting reference guide (0)  
Please note that I did the 2.0 guide unofficially after I'd been playing with it for a while. I have no idea if anybody from the Caravel team or beta testers is already planning some comprehensive document. Be sure to check the in-game Help files for now, of course.

I'd be willing to do this sort of thing again, but only after I'm most of the way through the full TCB. So probably a couple of months, unless somebody else acts sooner.

04-03-2007 at 01:51 PM
View Profile Send Private Message to User Send Email to User Show all user's posts This architect's holds Quote Reply
Syntax
Level: Smitemaster
Rank Points: 1218
Registered: 05-12-2005
IP: Logged
icon Re: Scripting reference guide (0)  
Will there be an official scripting guide for 3.x?
The 2.0 guide was excellent...
09-17-2007 at 03:05 PM
View Profile Send Private Message to User Show all user's posts Quote Reply
Someone Else
Level: Smitemaster
Avatar
Rank Points: 1300
Registered: 06-14-2005
IP: Logged
icon Re: Scripting reference guide (+1)  
I, as Scriptmaster, have begun this project.

[Last edited by Someone Else at 10-01-2007 07:13 AM]
10-01-2007 at 07:12 AM
View Profile Send Private Message to User Send Email to User Show all user's posts High Scores This architect's holds Quote Reply
Sillyman
Level: Smiter
Avatar
Rank Points: 339
Registered: 09-08-2006
IP: Logged
icon Re: Scripting reference guide (0)  
Woo! It's good to see my (soon to be) bureaucratic good twin get something done!

____________________________
Who, me?
FNORD
10-02-2007 at 08:28 AM
View Profile Send Private Message to User Show all user's posts Quote Reply
Kallor
Level: Master Delver
Rank Points: 277
Registered: 04-02-2007
IP: Logged
icon Re: Scripting reference guide (+1)  
Just something I came up with:

To take the sign (+1,-1 or 0) of a given variable x, do the following.
1. Set y=x.
2. If y=0 skip numbers 3 and 4.
3. Set y = 2y+1 (to make it odd).
4. Set y % 2.
5. Now y = sign(x).

This could be useful sometimes, I hope someone needs it :)

-Kallor

____________________________
Kallor
09-22-2008 at 10:09 AM
View Profile Send Private Message to User Show all user's posts This architect's holds Quote Reply
zex20913
Level: Smitemaster
Avatar
Rank Points: 1721
Registered: 02-04-2003
IP: Logged
icon Re: Scripting reference guide (0)  
These links are down. :( I was looking for some scripting aids. As such, we should either unsticky this, or relink.

____________________________
Click here to view the secret text

03-27-2009 at 04:28 PM
View Profile Send Private Message to User Send Email to User Show all user's posts Quote Reply
Syntax
Level: Smitemaster
Rank Points: 1218
Registered: 05-12-2005
IP: Logged
icon Re: Scripting reference guide (0)  
I believe they're fixed. Works for me...
04-03-2009 at 11:34 PM
View Profile Send Private Message to User Show all user's posts Quote Reply
Casebier
Level: Master Delver
Avatar
Rank Points: 283
Registered: 08-03-2005
IP: Logged
icon Re: Scripting reference guide (0)  
Guide no longer available. I'm thinking he no longer goes to that college.

____________________________
Casebier
--------------------------------
Revisiting old Project: ZelDROD 1 / ZelDROD RPG (If I can ever find the custom graphic files that I made for it.)
03-22-2013 at 12:30 AM
View Profile Send Private Message to User Show all user's posts Quote Reply
Casebier
Level: Master Delver
Avatar
Rank Points: 283
Registered: 08-03-2005
IP: Logged
icon Re: Scripting reference guide (0)  
Ack, sorry for resurrecting the thread. I was just following a link from a stickied post.

____________________________
Casebier
--------------------------------
Revisiting old Project: ZelDROD 1 / ZelDROD RPG (If I can ever find the custom graphic files that I made for it.)
03-22-2013 at 12:31 AM
View Profile Send Private Message to User Show all user's posts Quote Reply
schep
Level: Smitemaster
Avatar
Rank Points: 865
Registered: 03-01-2005
IP: Logged
icon Re: Scripting reference guide (0)  
Oh yeah, I guess that was hosted there. MSU was generous with extending old accounts for years, but finally decided to put a limit on it. Hmmmm...
03-22-2013 at 12:40 AM
View Profile Send Private Message to User Send Email to User Show all user's posts This architect's holds Quote Reply
Dreadcog
Level: Roachling
Rank Points: 10
Registered: 02-09-2014
IP: Logged
icon Re: Scripting reference guide (0)  
Hi Everyone,

I was wondering if there is a new link for the Scripting Guide?

Thanks. :D
02-13-2014 at 01:24 AM
View Profile Send Private Message to User Show all user's posts Quote Reply
mrimer
Level: Legendary Smitemaster
Avatar
Rank Points: 5056
Registered: 02-04-2003
IP: Logged
icon Re: Scripting reference guide (0)  
I don't think I have a copy, even if it's an older one. If anyone else does, would you please post it here?

____________________________
Gandalf? Yes... That's what they used to call me.
Gandalf the Grey. That was my name.
I am Gandalf the White.
And I come back to you now at the turn of the tide.
02-13-2014 at 06:02 AM
View Profile Send Private Message to User Send Email to User Show all user's posts High Scores This architect's holds Quote Reply
Dreadcog
Level: Roachling
Rank Points: 10
Registered: 02-09-2014
IP: Logged
icon Re: Scripting reference guide (0)  
Thanks for trying. :) I guess I missed out.
02-14-2014 at 06:01 PM
View Profile Send Private Message to User Show all user's posts Quote Reply
Tim
Level: Smitemaster
Avatar
Rank Points: 1979
Registered: 08-07-2004
IP: Logged
icon Re: Scripting reference guide (+5)  
Well, there's still the old one on some old site :D :

http://forum.caravelgames.com/site/scripting

____________________________
The best way to lose customers is to let little kids running loose on a forum with too many mod points.
02-14-2014 at 11:18 PM
View Profile Send Private Message to User Show all user's posts This architect's holds Quote Reply
Dreadcog
Level: Roachling
Rank Points: 10
Registered: 02-09-2014
IP: Logged
icon Re: Scripting reference guide (0)  
Thanks so much!!! :D Are there any updated commands I should know or is it fine for scripting?
02-15-2014 at 07:43 AM
View Profile Send Private Message to User Show all user's posts Quote Reply
mrimer
Level: Legendary Smitemaster
Avatar
Rank Points: 5056
Registered: 02-04-2003
IP: Logged
icon Re: Scripting reference guide (0)  
Thanks, Tim! You'd be a good archivist.

____________________________
Gandalf? Yes... That's what they used to call me.
Gandalf the Grey. That was my name.
I am Gandalf the White.
And I come back to you now at the turn of the tide.
02-18-2014 at 10:36 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
schep
Level: Smitemaster
Avatar
Rank Points: 865
Registered: 03-01-2005
IP: Logged

File: DRODScriptRef.txt (32.5 KB)
Downloaded 117 times.
License: Creative Commons
Attribution 4.0 International
icon Re: Scripting reference guide (+5)  
Found it.

Note it's still just the JtRH engine.

Caravel Games may use this file in any way they like. The CC license is for anyone else.

[Last edited by schep at 02-19-2014 04:16 AM]
02-19-2014 at 04:16 AM
View Profile Send Private Message to User Send Email to User Show all user's posts This architect's holds Quote Reply
Page 1 of 2
2
New Topic New Poll Post Reply
Caravel Forum : DROD Boards : Architecture : Scripting reference guide (For character scripting in 2.0)
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.8
Originally created by Toan Huynh (Copyright © 2000)
Enhanced by the tForumHacks team and the Caravel team.