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


Caravel Forum : DROD Boards : Architecture : Script database (This is where people who want to share put their general scripts.)
1
Page 2 of 2
New Topic New Poll Post Reply
Poster Message
skell
Level: Legendary Smitemaster
Avatar
Rank Points: 3734
Registered: 12-28-2004
IP: Logged
icon Re: Script database (0)  
See your point. I actually wanted to do something among these lines, but when I saw the complicity, I realized it would be like 20 lines of code.
You're completely right of course. I'll have to make a working RNG this time ^^.

____________________________
My website | Facebook | Twitter
01-26-2008 at 11:34 AM
View Profile Send Private Message to User Send Email to User Visit Homepage Show all user's posts High Scores This architect's holds Quote Reply
RoboBob3000
Level: Smitemaster
Avatar
Rank Points: 1978
Registered: 10-23-2003
IP: Logged

File: AppearAtAnywhere.txt (101.8 KB)
Downloaded 79 times.
License: Public Domain
icon Re: Script database (+4)  
Attached is a text file containing code that will allow a character to AppearAt any tile in the room if given coordinates to use. Just populate the variable DestX with your x-coordinate and DestY with your y-coordinate and you're good to go!

This is a brute-force method that I generated programmatically. I use this a great deal in my hold-in-the-works Porthole without any noticable problems other than smply occupying many lines of code.

If anybody can trim this down or come up with a better method to do the same thing, please share.

____________________________
http://beepsandbloops.wordpress.com/
01-30-2008 at 05:43 PM
View Profile Send Private Message to User Show all user's posts This architect's holds Quote Reply
Timo006
Level: Smitemaster
Avatar
Rank Points: 518
Registered: 07-19-2006
IP: Logged

File: Test.hold (3.2 KB)
Downloaded 64 times.
License: Public Domain
icon Re: Script database (+3)  
Included here is a hold which features the input of a name with a maximum of 10 characters. I've put it in a hold because it's linked to certain locations in the room.

It features
-normal characters
-CAPITAL CHARACTERS
-all the numbers from 0 to 9
-other characters like ? , ! . - _ + and *

EDIT: This should be the lines you need for it.

Click here to view the secret text


EDIT: Note that it is possible tochange the maximum characters allowed. but it will take a bit of work if you want to change that.

____________________________
Drod Number: 3034; 8th person to see the Second Sky

[Last edited by Timo006 at 02-07-2008 12:14 PM]
02-05-2008 at 09:03 PM
View Profile Send Private Message to User Send Email to User Show all user's posts This architect's holds Quote Reply
Dischorran
Level: Smitemaster
Avatar
Rank Points: 3407
Registered: 09-10-2005
IP: Logged
icon Re: Script database (+3)  
I'll go ahead and post the code for the guardians from my Al Dente 2 hold. It's for an invulnerable monster that waits until Beethro stabs a monster and then moves to his location at that time. It comes in two parts.

The first part is for an invisible character that waits for a monster to be stabbed (not necessariy by Beethro, unfortunately) and then stores Beethro's location into PlayerX and PlayerY. Everything works best if this character is placed before the other(s); only one is required to control all guardians in the room. Someone Else might recognize most of the code:

Click here to view the secret text


This one is for the critter itself. It takes the (PlayerX, PlayerY) set by the monitoring character and applies roach movement rules to move there, with an initial "Wait for monster stabbed" to make it start stationary:

Click here to view the secret text

Those final move commands need to have "Single step" added to them. Hopefully there aren't any other import/export issues.

While I haven't tried it, I would imagine that removing the "wait for monster stabbed" commands from both characters would yield a character with true roach-like movement. I would also imagine that modification of the last part of the second character would give a character with roach queen-like movement, or a roach with horizontal movement preference, or so on.

This code is free for use* and modification, and all that.


*Not intended for use as a random number generator.

____________________________
Click here to view the secret text

04-09-2008 at 05:33 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
Lucky Luc
Level: Smitemaster
Rank Points: 1215
Registered: 08-19-2012
IP: Logged
icon Re: Script database (+1)  
Bumping this one back up, because I think this is a pretty cool thread actually. I've made a script that... uhm... counts stuff. Doesn't sound terribly exciting, I know, so here's the catch: This script allows you to check every tile in the room for something (for example monsters) and then do something with it while using relatively little variable changes, so that infinite loop recognition isn't all that harmful. It will still fail if there's too much of whatever you're looking for in the room, but it should suffice for many cases.

Here's the script, of course completely free to use for whatever:
Click here to view the secret text

Lines you could/should change are marked blue. Also note that this script doesn't actually count monsters, but rather monster-filled tiles.

[Last edited by Lucky Luc at 09-22-2013 08:17 PM]
09-22-2013 at 05:57 PM
View Profile Send Private Message to User Show all user's posts This architect's holds Quote Reply
The spitemaster
Level: Smiter
Rank Points: 354
Registered: 06-09-2005
IP: Logged
icon Re: Script database (0)  
Lucky do you really want wait 1 in there? I'm thinking wait 0 would be a better option. But I may not remember how the scripting works.

____________________________
Last night upon a stair
I met a man that wasn't there
He wasn't there again today
I wish that man would stay away
09-22-2013 at 06:36 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
Lucky Luc
Level: Smitemaster
Rank Points: 1215
Registered: 08-19-2012
IP: Logged
icon Re: Script database (0)  
I think they're pretty much the same, actually. Both are kind of weird on turn 0 and 1 but work perfectly afterwards. I don't think there are any applications where the difference actually matters, but feel free to prove me wrong ;)

EDIT: I do agree, though, that that is definitely a line that can be changed. Updated.

[Last edited by Lucky Luc at 09-22-2013 08:16 PM]
09-22-2013 at 07:00 PM
View Profile Send Private Message to User Show all user's posts This architect's holds Quote Reply
Someone Else
Level: Smitemaster
Avatar
Rank Points: 1304
Registered: 06-14-2005
IP: Logged
icon Re: Script database (+1)  
Nah, the difference is when combined with other actions. Some commands take up a turn (like moving); Wait 1 when combined with these can sometimes wait more turns than intended. Wait 0 is usually the safer bet. I think it's fine in your case, but it's always good practice to use Wait 0 so there aren't any bugs in your code.
09-23-2013 at 12:30 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
Lucky Luc
Level: Smitemaster
Rank Points: 1215
Registered: 08-19-2012
IP: Logged
icon Re: Script database (0)  
Okay, I get your point now. I was talking about my code specifically, where it doesn't really matter (that block is only meant for testing/demonstration, anyway), and I also didn't really have problems with Wait 1 yet, but I'll keep it in mind.
09-23-2013 at 09:35 AM
View Profile Send Private Message to User Show all user's posts This architect's holds Quote Reply
1
Page 2 of 2
New Topic New Poll Post Reply
Caravel Forum : DROD Boards : Architecture : Script database (This is where people who want to share put their general scripts.)
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.