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


Caravel Forum : DROD Boards : Architecture : Scripting help needed (This might just be impossible though)
New Topic New Poll Post Reply
Poster Message
Kallor
Level: Master Delver
Rank Points: 277
Registered: 04-02-2007
IP: Logged
icon Scripting help needed (0)  
Hello,

I'm trying to create my own special character monster, but I ran into some problems. My goal might just be impossible but I'm not really a programmer and it's been a while since I tried anything with DROD scripting language so maybe there's some hope.

I made the guy move like a roach by putting a "Imperative Flexible Beelining" at start, and then made a big "If ..."-tree checking in which direction he wants to move by using the (very useful new addition) "_X", "_Y", "_MyX" and "_MyY" default variables. Finally I use the "Move" command to take a single step to the desired direction, and loop back to start of the tree (no "Wait 0 turn(s)" command there, that would make they guy skip half of the turns for some reason, I don't exactly understand how that works). So OK, the guy moves like a roach.

The problem is that the turn always ends immediately after the step, and I wanted to check some extra stuff before Beethro's turn. I will need the characters new position which can't be predicted since he might do flexible beelining or just hit a wall without moving at all, and there's no way to check whether a tile is wall or not (actually with multiple monsters predictions would be impossible even if I could detect walls and floors). So is there a way to extend the character's turn a bit after the step until I'm ready to let Beethro move? Or do something entirely differently?


____________________________
Kallor

[Last edited by Kallor at 11-28-2012 01:11 PM]
11-28-2012 at 01:00 PM
View Profile Send Private Message to User Show all user's posts This architect's holds Quote Reply
navithmastero
Level: Smitemaster
Avatar
Rank Points: 626
Registered: 01-03-2012
IP: Logged
icon Re: Scripting help needed (+1)  
I'm honestly not too sure, but if you want some guaranteed help, ask Someone Else. :)

-nm

____________________________
Member of the Snake Appreciation Society

One of your local HAs.

My stuff:
Click here to view the secret text

11-28-2012 at 01:10 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
Someone Else
Level: Smitemaster
Avatar
Rank Points: 2358
Registered: 06-14-2005
IP: Logged
icon Re: Scripting help needed (+1)  
Well, that's a tricky one. There actually is a way to check what it is (but if you use obstacles or pit or anything else that isn't wall, you'll run into issues or have to make multiple checks) - use 'Wait for item'. Unfortunately, no, there isn't a way to extend the character's turn. You'll have to do everything before you move.

I assume your code looks like this:
Click here to view the secret text


The reason that you can't use wait 0 there is that it always ends execution for the turn. So it will move, stop execution, and then next turn see wait 0 and stop execution.

There is one other way to do it, if they aren't going to run into each other. If you place a character in between each of the monsters in the movement order, then have the monsters pass intended direction and location in variables to the other characters, those characters can find the monster and perform whatever action is required.

This reminds me; I have to add something to my list of things that the scripting engine is missing.
11-28-2012 at 04:38 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
Kallor
Level: Master Delver
Rank Points: 277
Registered: 04-02-2007
IP: Logged
icon Re: Scripting help needed (0)  
Oh I somehow missed "Wait for item", it's not like it's a new feature or anything... won't help me here though.

Thanks for explaining stuff, it looks like I'm gonna have to try your idea of extra characters next.

EDIT: Success! First thing a monster does each turn is checking whether or not it died on player's last turn. (I don't know if normal monsters actually behave like this in the game, that might be a decent way to keep things organized.) All that was needed was one extra character acting first and taking some notes on player's actions. My original question was a bit too general, surely one extra character doesn't help in most situations. I made a monster that can only be stabbed (not sliced), and the original approach of making it temporarily vulnerable if it moves in front of player's sword was all wrong.

____________________________
Kallor

[Last edited by Kallor at 11-29-2012 11:05 AM]
11-28-2012 at 06:02 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 Boards : Architecture : Scripting help needed (This might just be impossible though)
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.9
Originally created by Toan Huynh (Copyright © 2000)
Enhanced by the tForumHacks team and the Caravel team.