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


Caravel Forum : DROD Boards : Architecture : Building Scripting Question (need help with a custom character)
New Topic New Poll Post Reply
Poster Message
Butch32
Level: Roachling
Rank Points: 7
Registered: 03-19-2011
IP: Logged
icon Building Scripting Question (0)  
I want to create a character, that if a withered briar is in its 3x3 square radius, it would turn into a briar root, using a default script for anywhere in the room.

Any assistance would be appreciated.

____________________________
Forthwarding...

[Last edited by Butch32 at 02-16-2018 10:51 PM]
02-16-2018 at 10:49 PM
View Profile Send Private Message to User Show all user's posts Quote Reply
Xindaris
Level: Smitemaster
Avatar
Rank Points: 1531
Registered: 06-13-2015
IP: Logged
icon Re: Building Scripting Question (0)  
To make a character do something relative to itself, you'll need myscript. So go read this primer on what myscript is and how it works first.

EDIT EDIT EDIT: I reread your description and everything I had written here was wrong. A little myscripting will do the job just fine. I believe one of the examples in the primer does almost exactly what you'd need to do to check for a withered-briar tile in the 3x3 radius even.

____________________________
109th Skywatcher

Here are some links to Things!
Click here to view the secret text


[Last edited by Xindaris at 02-16-2018 11:29 PM]
02-16-2018 at 11:21 PM
View Profile Send Private Message to User Show all user's posts High Scores This architect's holds Quote Reply
superluminal
Level: Delver
Rank Points: 75
Registered: 05-26-2016
IP: Logged
icon Re: Building Scripting Question (+1)  
Here's a script! Just create a custom character, name it "Butch32", and Ctrl-C -> Ctrl-Shift-B to copy/paste it in.
Click here to view the secret text

Sadly, it doesn't work, and I'm not sure why. If someone more versed than I would come along and fix its problems, I would be thankful. :)

And here's the code to make it a default script. Have a character in the room run this:
Click here to view the secret text

This code works!

____________________________
spacelike

[Last edited by superluminal at 02-17-2018 07:26 PM]
02-17-2018 at 08:19 AM
View Profile Send Private Message to User Show all user's posts This architect's holds Quote Reply
Xindaris
Level: Smitemaster
Avatar
Rank Points: 1531
Registered: 06-13-2015
IP: Logged
icon Re: Building Scripting Question (0)  
There's no "Wait 0" command. You need one of those to stop the turn so it doesn't just say "Oh this is an infinite loop all in one turn, KILL THE SCRIPT!" Just add "Wait 0" after setting _MyscriptX to -9999 and before going back to the start.

But I think this is actually more than what was wanted. A careful reading suggests the OP actually seems to want a root to be built if any tile in the 3x3 area around it is withered briar, not necessarily requiring that all of them are.

____________________________
109th Skywatcher

Here are some links to Things!
Click here to view the secret text


[Last edited by Xindaris at 02-17-2018 04:34 PM]
02-17-2018 at 04:34 PM
View Profile Send Private Message to User Show all user's posts High Scores This architect's holds Quote Reply
superluminal
Level: Delver
Rank Points: 75
Registered: 05-26-2016
IP: Logged
icon Re: Building Scripting Question (0)  
Good catch! Change: IMPLEMENTED!

It doesn't work on the first turn anyway. You're probably right that it's infinite loop stuff. The loop needs to jump around something like 15,000 times, and that's enough to trigger DROD's loop warnings. I don't know exactly what Butch32 wants -- but it's probably not this broken script! :)

____________________________
spacelike
02-19-2018 at 09:17 AM
View Profile Send Private Message to User Show all user's posts This architect's holds Quote Reply
New Topic New Poll Post Reply
Caravel Forum : DROD Boards : Architecture : Building Scripting Question (need help with a custom character)
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.