Announcement: Be excellent to each other.


Caravel Forum : DROD RPG Boards : RPG Architecture : Trapdoor drop script (free of charge!)
New Topic New Poll Post Reply
Poster Message
superluminal
Level: Delver
Rank Points: 52
Registered: 05-26-2016
IP: Logged
icon Trapdoor drop script (+3)  
While working on a level set, I couldn't find a way to let the player drop trapdoors if he didn't have an enabled sword equipped, so I developed this workaround. It's a little ugly and takes a lot of behind-the-scenes work (might cause lag on slow computers), but it gets the job done. This script will let the player drop trapdoors and toggle any trapdoor gates.

_trapdoorFinder
Click here to view the secret text

_reddoorFinder
Click here to view the secret text

trapdoorPit
Click here to view the secret text

trapdoorWater
Click here to view the secret text

How to use: In whatever room you want to start this, just put down a character with the following script:
  Generate entity _trapdoorFinder,0,0,northwest
  Generate entity _reddoorFinder,0,0,northwest

and it'll work its magic throughout the rest of the hold. Have fun!

____________________________
spacelike

[Last edited by superluminal at 07-02-2016 09:01 PM]
07-01-2016 at 03:17 AM
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: 1086
Registered: 06-14-2005
IP: Logged
icon Re: Trapdoor drop script (+1)  
Nice idea - but there are a few issues. Primarily that _MyScriptX and _MyScriptY are shared between characters and you're not resetting them back to their default values of -9999. It's likely that you'll run into issues if there are any other scripts in the hold. In particular, both of the first two scripts should end by setting both values to -9999.
07-01-2016 at 05:44 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
superluminal
Level: Delver
Rank Points: 52
Registered: 05-26-2016
IP: Logged
icon Re: Trapdoor drop script (+1)  
quote:
Someone Else wrote:
Primarily that _MyScriptX and _MyScriptY are shared between characters
No, they aren't. None of the _My variables are global. Each character gets its own value to play with. Heck, when an entity is generated it gets its own _MyScripts (already defaulted to -9999). I don't see your concern.

Were there any other issues you saw? I don't want to post faulty work.

____________________________
spacelike
07-01-2016 at 05:50 AM
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: 1086
Registered: 06-14-2005
IP: Logged
icon Re: Trapdoor drop script (+1)  
Wait, what, really?

... Oh yeah, you're right. Well, thanks for correcting me. Looks good, then!
07-01-2016 at 04:14 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
bomber50
Level: Smitemaster
Rank Points: 865
Registered: 09-18-2006
IP: Logged
icon Re: Trapdoor drop script (0)  
Couple lines don't parse into DROD properly:
Wait for item Trapdoor (over pit),0,0,0,0
Wait while entity is Player 0,0,0,0

For people trying this, note the script only works from (0,0) to (15,15), but you only need to change four lines for it to work in entire room. Also, other doubles/multipushes won't work properly.

07-01-2016 at 08:08 PM
View Profile Send Private Message to User Show all user's posts High Scores This architect's holds Quote Reply
kieranmillar
Level: Smitemaster
Rank Points: 1307
Registered: 07-11-2014
IP: Logged
icon Re: Trapdoor drop script (0)  
I think you've forgotten which forum this was posted in bomber50. This is for RPG.

____________________________
(07:23 PM) Pearls: Kieran is correct.
07-01-2016 at 08:39 PM
View Profile Send Private Message to User Show all user's posts High Scores This architect's holds Quote Reply
bomber50
Level: Smitemaster
Rank Points: 865
Registered: 09-18-2006
IP: Logged
icon Re: Trapdoor drop script (0)  
No wonder. :)

But kinda cool they both work in regular DROD/RPG without too many changes.
07-02-2016 at 05:07 AM
View Profile Send Private Message to User Show all user's posts High Scores This architect's holds Quote Reply
Aquitanius
Level: Goblin
Rank Points: 27
Registered: 05-27-2016
IP: Logged
icon Re: Trapdoor drop script (0)  
Oh, pretty cool. I placed the trapdoorPit Characters manually up until now.
I'll use your script from now on. Thanks for sharing. :)

EDIT: Changed my original comment because I misread the script first.


[Last edited by Aquitanius at 07-02-2016 04:16 PM]
07-02-2016 at 12:42 PM
View Profile Send Private Message to User Show all user's posts Quote Reply
superluminal
Level: Delver
Rank Points: 52
Registered: 05-26-2016
IP: Logged
icon Re: Trapdoor drop script (+1)  
Oops! There's an edge case I didn't think of: what if there's no trapdoors in the room? The script as-is will keep toggling red doors every time you enter the room, which is (obviously) not how trapdoor gates actually work. So I've added a small condition at the end of _trapdoorFinder that should fix this.

I've edited the script in the first post.

____________________________
spacelike
07-02-2016 at 09:03 PM
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 RPG Boards : RPG Architecture : Trapdoor drop script (free of charge!)
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.