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


Caravel Forum : DROD Boards : Architecture : YASQ: Yet Another Scripting Question (Involving Element Immunity)
New Topic New Poll Post Reply
Poster Message
Camwoodstock
Level: Delver
Avatar
Rank Points: 34
Registered: 07-02-2014
IP: Logged
icon YASQ: Yet Another Scripting Question (0)  
How would I make an NPC be immune to briar?

In the sense that, I can put it on Briar, or Briar wouldn't grow on the tile it occupies. Beethro could, of course, grab a Pickaxe and cut the briar, and then destroy the NPC. Destroying them would be necessary for clearing the room.

I want to make an NPC for a level I'm making that works like this. How'd I do that?

P.S. If this can't be done with current scripting... Well, it should totally be added someday. Possibly in an update to DROD's engine.

____________________________
Camwoodstock - The Epic Blunder, Dugan's Best Janitor, and Lowest Point Tourist
Mastered of Gunthro and the Epic Blunder! (postmastery complete!)
Mastered all of KDD 2.0!
Conquered TCB! (plenty o' secret rooms though!)

[Usually Camwoodstock | Reddit is Camwood7 | Wikia is Camwood777 | DashNet Forums is Cookiewoodstock]

[Last edited by Camwoodstock at 12-11-2016 03:09 PM]
12-11-2016 at 03:06 PM
View Profile Send Private Message to User Show all user's posts High Scores Quote Reply
Nuntar
Level: Smitemaster
Avatar
Rank Points: 3086
Registered: 02-20-2007
IP: Logged
icon Re: YASQ: Yet Another Scripting Question (0)  
There's only one way to do this, and it's a clumsy hack: Invisible + Ghost Display.

This won't prevent briar occupying its tile. If you want that too, you have to check every turn for briar on the tile, and remove it if it appears.

Invisible will also make Beethro able to step on, or put his sword on, the character with no effects. To make the character act "solid", you have to: (1) Have another character that, every turn, stores Beethro's position in custom variables. Your NPC should then "Wait for player to touch me" followed by returning Beethro to the tile he just occupied.
(2) Also have your character check, every turn, whether Beethro's sword is on his tile, and if so, use Imperative Die. (3) Don't use any mimics / other sworded entities / other weapons together with this character, unless you're prepared to do a lot more scripting.

Yeah, I agree it would be nice to have a simple "Imperative Invulnerable to briar" to avoid all this. Maybe we'll get it in a future version.

____________________________
50th Skywatcher
12-11-2016 at 05:14 PM
View Profile Send Private Message to User Show all user's posts High Scores This architect's holds Quote Reply
blorx1
Level: Smitemaster
Rank Points: 838
Registered: 07-18-2009
IP: Logged
icon Re: YASQ: Yet Another Scripting Question (0)  
An alternative hack that might be more restrictive is to build hot tile underneath the character. I think there might be a way to restore most tiles that the character steps off, but it means that you wouldn't be able to use said character with things like doors.

____________________________
If you need to think outside of the box, then you didn't build a good enough box.

[Last edited by blorx1 at 12-11-2016 05:42 PM]
12-11-2016 at 05:42 PM
View Profile Send Private Message to User Show all user's posts High Scores This architect's holds Quote Reply
Chaco
Level: Smitemaster
Rank Points: 3091
Registered: 10-06-2005
IP: Logged
icon Re: YASQ: Yet Another Scripting Question (0)  
It might be simpler to just make the NPC invulnerable, but then, on its turn, have it check to see whether the player is stabbing it (is adjacent to it and is facing the appropriate direction to have their weapon on top of it), and if so, kill themselves off appropriately.

Note that invulnerable NPCs can't be required targets, and this wouldn't take into account things like doubles, guards/slayers/adders, bombs/hot tiles/fire traps, etc. which wouldn't be able to kill the NPC, so it would have to be designed around by not including those elements. But, it might be easier to script.

____________________________
Quick links to my stuff (in case you forgot where it was):
Click here to view the secret text

12-11-2016 at 06:07 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
Xindaris
Level: Smiter
Avatar
Rank Points: 422
Registered: 06-13-2015
IP: Logged
icon Re: YASQ: Yet Another Scripting Question (0)  
The problem to begin with is that "invulnerable" to the DROD engine really means "invulnerable, but not to briar". It's why the blocks in Blockerture die to briar. If for some reason the proposed creature doesn't ever need to move then a hot tile or cracked wall under it (depending on what it's supposed to behave like) would be best for not screwing with briar growth timing mechanics.

Feel free to put up a feature request for "Imperative: isn't hurt by briar" if you'd like.

____________________________
109th Skywatcher

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


[Last edited by Xindaris at 12-11-2016 08:15 PM]
12-11-2016 at 08:07 PM
View Profile Send Private Message 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 : YASQ: Yet Another Scripting Question (Involving Element Immunity)
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.