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


Caravel Forum : DROD Boards : Architecture : Scripting questions
New Topic New Poll Post Reply
Poster Message
Tahnan
Level: Smitemaster
Avatar
Rank Points: 2467
Registered: 11-14-2005
IP: Logged

File: Scripting Lesson.hold (1.1 KB)
Downloaded 49 times.
License: Public Domain
icon Scripting questions (0)  
1. Is there a good guide to scripting anywhere on the site? There's...well, a guide in the DBoD, but it's a little sketchy in places.

2. Is there a "if the blue walls have been dropped..." command?

3. Just to prove how little I understand what's going on, consider the attached hold. The two guards differ in a single line in their scripts, and even that line is essentially the same command. So why does one say "Ni!" while the other doesn't?
03-29-2006 at 06:59 AM
View Profile Send Private Message to User Show all user's posts High Scores This architect's holds Quote Reply
RoboBob3000
Level: Smitemaster
Avatar
Rank Points: 1982
Registered: 10-23-2003
IP: Logged
icon Re: Scripting questions (+1)  
Your problem here is that the line "speech guard" gets triggered twice simultaneously. That command makes a guard give it's speech, presumably the one first placed. You'll see that if you remove the speech command from the lower guard and leave it in the upper guard, the lower guard will still give the speech.

Instead of choosing "guard", I think in this case you'll want to choose "custom". After you select custom, you will be prompted to choose a square you want the speech to originate from. You should click on the appropriate guard.

Now that I think about it, if these guards will be moving, I don't know how the custom command will help you out, but that's gonna be what you want to experiment with in this case.

____________________________
http://beepsandbloops.wordpress.com/
03-29-2006 at 07:47 AM
View Profile Send Private Message to User Show all user's posts This architect's holds Quote Reply
Rabscuttle
Level: Smitemaster
Avatar
Rank Points: 2539
Registered: 09-10-2004
IP: Logged
icon Re: Scripting questions (+1)  
Tahnan wrote:
2. Is there a "if the blue walls have been dropped..." command?

if _ goto blah
Wait for Door to Open at (blue door coords).
03-29-2006 at 08:45 AM
View Profile Send Private Message to User Show all user's posts High Scores This architect's holds Quote Reply
Tahnan
Level: Smitemaster
Avatar
Rank Points: 2467
Registered: 11-14-2005
IP: Logged
icon Re: Scripting questions (0)  
RoboBob3000 wrote:
Your problem here is that the line "speech guard" gets triggered twice simultaneously.

Interesting--but not the problem. Try deleting the lower guard. In that case, you don't have the double-guard-speech-trigger problem. But the upper guard still doesn't say "Ni!".
03-29-2006 at 09:26 AM
View Profile Send Private Message to User Show all user's posts High Scores This architect's holds Quote Reply
Oneiromancer
Level: Legendary Smitemaster
Avatar
Rank Points: 2936
Registered: 03-29-2003
IP: Logged
icon Re: Scripting questions (+1)  
Tahnan wrote:
1. Is there a good guide to scripting anywhere on the site? There's...well, a guide in the DBoD, but it's a little sketchy in places.
Well, there is this post, about three above yours currently. It might be a bit too specific, but it explains everything in excruciating detail.

The answer to 2 given by Rabscuttle is also perfectly correct. "Wait for Door..." commands work on any type of door, not just yellow ones.

Game on,

____________________________
"He who is certain he knows the ending of things when he is only beginning them is either extremely wise or extremely foolish; no matter which is true, he is certainly an unhappy man, for he has put a knife in the heart of wonder." -- Tad Williams
03-29-2006 at 01:42 PM
View Profile Send Private Message to User Send Email to User Show all user's posts This architect's holds Quote Reply
Tahnan
Level: Smitemaster
Avatar
Rank Points: 2467
Registered: 11-14-2005
IP: Logged
icon Re: Scripting questions (0)  
Oneiromancer wrote:
Well, there is this post, about three above yours currently. It might be a bit too specific, but it explains everything in excruciating detail.

No, that's pretty much exactly what I wanted. Sticky topics are really, really useful, until you've seen them so many times that you stop seeing them. Thanks!
03-29-2006 at 06:37 PM
View Profile Send Private Message to User Show all user's posts High Scores This architect's holds Quote Reply
RoboBob3000
Level: Smitemaster
Avatar
Rank Points: 1982
Registered: 10-23-2003
IP: Logged
icon Re: Scripting questions (+1)  
Aha! Figured it out!

You're going to want to add the line "wait 1 turn" after the "waiting" label for both guards. That way the loop doesn't continue indefinately after one turn. This will force it to stop between moves.

I don't exactly know how one guard managed to say "Ni!" at all without those lines added. I figure it's some consequence of turn order that's beyond my simple mind. In any case, that's what you want.

____________________________
http://beepsandbloops.wordpress.com/
03-29-2006 at 07:08 PM
View Profile Send Private Message to User Show all user's posts This architect's holds Quote Reply
Doom
Level: Smitemaster
Avatar
Rank Points: 3378
Registered: 07-05-2004
IP: Logged
icon Re: Scripting questions (+1)  
RoboBob3000 wrote:
I don't exactly know how one guard managed to say "Ni!" at all without those lines added. I figure it's some consequence of turn order that's beyond my simple mind. In any case, that's what you want.
This is because "face direction SE" doesn't take a turn, but "face direction clockwise" takes. As said by RoboBob, the unlimited loop was the problem with the upper guard.

If you want simultaneous speech, setting speech delay to 1 ms. should work. Currently, the lines play one after each other even if you tweak them to play at the same time.

By the way, the script for the upper guard works in the exact same way if you remove the labels completely.
03-29-2006 at 07:54 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
geomatrx
Level: Smiter
Avatar
Rank Points: 339
Registered: 08-31-2004
IP: Logged
icon Re: Scripting questions (0)  
Doom wrote:
RoboBob3000 wrote:
If you want simultaneous speech, setting speech delay to 1 ms. should work.

Or, you could add the 'Flush Speach' command before each guard says "Ni". Both will say it at the same time - no delay.

g

____________________________
Get my holds:
MetDROiD AE
MetDROiD Prime

MetDROiD Echoes
Deadly Gold Mine of Death (Architecture)
03-30-2006 at 01:02 AM
View Profile Send Private Message to User Show all user's posts This architect's holds Quote Reply
Tahnan
Level: Smitemaster
Avatar
Rank Points: 2467
Registered: 11-14-2005
IP: Logged
icon Re: Scripting questions (0)  
RoboBob3000 wrote:
Aha! Figured it out!

You're going to want to add the line "wait 1 turn" after the "waiting" label for both guards. That way the loop doesn't continue indefinately after one turn. This will force it to stop between moves.

I finally figured this out by reading the abovementioned guide to scripting: it's all about the difference between a "free" command and an "action" command. Wasn't expecting that.

Though it'd be nice if using "wait 0", thereby creating an infinite loop, would give an error message, rather than crashing DROD.
03-30-2006 at 05:37 AM
View Profile Send Private Message to User Show all user's posts High Scores This architect's holds Quote Reply
mrimer
Level: Legendary Smitemaster
Avatar
Rank Points: 5460
Registered: 02-04-2003
IP: Logged
icon Re: Scripting questions (0)  
Tahnan wrote:
Though it'd be nice if using "wait 0", thereby creating an infinite loop, would give an error message, rather than crashing DROD.
Eh? It shouldn't do either of these.
03-31-2006 at 09:49 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
Tahnan
Level: Smitemaster
Avatar
Rank Points: 2467
Registered: 11-14-2005
IP: Logged
icon Re: Scripting questions (0)  
mrimer wrote:
Tahnan wrote:
Though it'd be nice if using "wait 0", thereby creating an infinite loop, would give an error message, rather than crashing DROD.
Eh? It shouldn't do either of these.

Aaaaand....it's not doing them again. But I've got a nice long series of "*** FIRST LOG IN SESSION 3/28/06 3:21PM *** Character script is in an infinite loop" messages. Followed, as it happens, by some

Assertion error in line 287 of C:\\Caravel\\DROD17\\DRODLib\\DbSpeech.cpp: "SpeechID is bad."
Assertion error in line 966 of C:\\Caravel\\DROD17\\DRODLib\\Character.cpp: "command.pSpeech"

which seemed to have something to do with one of the guards' speeches getting deleted and replaced with a "?". If I can get it to repeat, I'll (a) be very sorry, and (b) report it a a bug.
04-01-2006 at 08:35 AM
View Profile Send Private Message to User Show all user's posts High Scores This architect's holds Quote Reply
Doom
Level: Smitemaster
Avatar
Rank Points: 3378
Registered: 07-05-2004
IP: Logged
icon Re: Scripting questions (0)  
Tahnan wrote:
Followed, as it happens, by some

Assertion error in line 287 of C:\\Caravel\\DROD17\\DRODLib\\DbSpeech.cpp: "SpeechID is bad."
Assertion error in line 966 of C:\\Caravel\\DROD17\\DRODLib\\Character.cpp: "command.pSpeech"

which seemed to have something to do with one of the guards' speeches getting deleted and replaced with a "?".
Yep. This definitely sounds familiar. I didn't create any infinite loops, though.

As for the wait 0 thing, I'm not getting anything either. Maybe your script had something else in it when it looped?
04-01-2006 at 08:45 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
New Topic New Poll Post Reply
Caravel Forum : DROD Boards : Architecture : Scripting questions
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.