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


Caravel Forum : DROD Boards : Architecture : Scripting Question: Rock piles
New Topic New Poll Post Reply
Poster Message
Jacob
Level: Smitemaster
Rank Points: 3746
Registered: 10-01-2004
IP: Logged
icon Scripting Question: Rock piles (0)  
So, I can see how to turn a scripted rock golem into a rock pile (Die Special), but how do I make this happen when the player kills the scripted character?

There is no way to check if "I am killed"...except if I make a convoluted script that checks for the player in an adjacent tile with a sword pointed at me...but then that doesn't cover other causes of death (e.g. hit by guard, standing on hottiles).

Thanks

____________________________
New to DROD? You may want to read this.
My Holds and Levels:
Click here to view the secret text

03-09-2015 at 09:27 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
Dischorran
Level: Smitemaster
Avatar
Rank Points: 3407
Registered: 09-10-2005
IP: Logged
icon Re: Scripting Question: Rock piles (0)  
I tested this using my entropic aumtlich as a starting point, and it's sortakinda possible. You can have the NPC update a pair of global variables with its coordinates after it moves. A later-acting monitor script then checks if there's an NPC at the stored coordinates, and if not, spawns a rock golem there and attacks the tile to make it a rock pile.

Of course, this needs a separate monitor and pair of global variables for each scripted golem in the room. And it breaks if you push these NPCs. And I'm pretty sure you have to manually calculate the square to be moved to and teleport there, instead of using the built-in move functions, so that the XY position can be updated after the move in the same turn. So it's sort of not a great solution.

____________________________
Click here to view the secret text

03-09-2015 at 11:00 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
Nuntar
Level: Smitemaster
Avatar
Rank Points: 4592
Registered: 02-20-2007
IP: Logged
icon Re: Scripting Question: Rock piles (0)  
While it doesn't cover all cases, checking for the player's sword hitting the monster is not convoluted:
If...
  Wait until var _MyX = _X + (_O % 3) - 1
  If...
    Wait until var _My = _Y + (_O / 3) - 1


____________________________
50th Skywatcher
03-09-2015 at 11:02 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 : Scripting Question: Rock piles
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.