Announcement: Remember: you are giving away your fantastic ideas for free, and somebody else might even make money from them (or appear to). That's just how the world works! If you're worried about it, maybe you shouldn't post your ideas here.


Caravel Forum : DROD Boards : Feature Requests : Various Scripting Improvements (Or: The 90's are over)
New Topic New Poll Post Reply
Poster Message
hyperme
Level: Smitemaster
Avatar
Rank Points: 1055
Registered: 06-23-2006
IP: Logged
icon Various Scripting Improvements (+1)  
So DRODscript is actually pretty powerful now. You can do a bunch of stuff a make all kinds of neat custom elements. However, there a various features that would either be nice, or should probably already exist because we aren't actually writing in Assembly.


Else If

Flow control? In my DROD? It's more likely than you think. Also this would be seriously convenient for both writing and reading scripts.

Face Towards

Like Move To, only with orientation. By default, you put in a room position and it looks at it. You can also choose Single Step, causing a rotation towards something. Choosing a target instead of a position would also be nice. _MyScript vars do stuff, I guess.

Wait until Facing

Specifically, this checks to see if the NPC is facing a thing or position. You can already test for a direction using _MyO.

Distance Between Points

Put in two (x,y) co-ordinates, get the distance in number of spaces.

Wait until Injured

Technically, this only works on invincible dudes. Pick some kind of violent end to wait for. If you don't pick one, it goes off whenever the NPC would be killed if not for their immortality.

Wait for Spawn Cycle Turn

Like wait for turn, only between 0-29.

Each Event

DROD RPG had these really neat commands that let you jump the script to a label on certain events, like attacks. Some of these would be neat for regular DROD. Useful ones might include Each Spawn Cycle Start, Each Monster Kill, Each Injury, etc.


____________________________
[Insert witty comment here]
Qzvlkx?
02-01-2015 at 04:18 PM
View Profile Send Private Message to User Show all user's posts High Scores This architect's holds Quote Reply
Pinnacle
Level: Smitemaster
Avatar
Rank Points: 1126
Registered: 06-10-2004
IP: Logged
icon Re: Various Scripting Improvements (0)  
If we're still adding script commands, mind if I necro my request from a while back?

Wait for Challenge Completed: Just what it says. It's a check that passes if the challenge you set is completed.

_ChallengesCompleted variable: A variable that contains the total number of challenges the player completed.

I know these are very abusable, but that's why we have HAs.

(thread for it: http://forum.caravelgames.com/viewtopic.php?TopicID=38987&page=0#389714)

____________________________
Once (adv.): Enough.
Twice (adv.): Once too often.
~Ambrose Bierce, The Devil's Dictionary
02-01-2015 at 07: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
skell
Level: Legendary Smitemaster
Avatar
Rank Points: 3734
Registered: 12-28-2004
IP: Logged
icon Re: Various Scripting Improvements (+3)  
TSS 5.0.2 will feature Else If!

____________________________
My website | Facebook | Twitter
02-08-2015 at 07:59 PM
View Profile Send Private Message to User Send Email to User Visit Homepage Show all user's posts High Scores This architect's holds Quote Reply
Banjooie
Level: Smitemaster
Avatar
Rank Points: 1645
Registered: 12-12-2004
IP: Logged
icon Re: Various Scripting Improvements (+2)  
Can I request it be the 90s again

I miss purple backgrounds with squiggly shapes
02-15-2015 at 08:08 AM
View Profile Send Private Message to User Show all user's posts This architect's holds Quote Reply
kieranmillar
Level: Smitemaster
Rank Points: 2668
Registered: 07-11-2014
IP: Logged
icon Re: Various Scripting Improvements (+1)  
Wait for event Monster Stunned would be cool.
02-27-2015 at 09:09 PM
View Profile Send Private Message to User Show all user's posts High Scores This architect's holds Quote Reply
skell
Level: Legendary Smitemaster
Avatar
Rank Points: 3734
Registered: 12-28-2004
IP: Logged
icon Re: Various Scripting Improvements (+1)  
I am happy to say that command "Face towards like guard" has been added and can be used both as a action and as a condition in an if statement in 5.0.2.

____________________________
My website | Facebook | Twitter

[Last edited by skell at 04-17-2015 09:36 PM]
04-17-2015 at 09:24 PM
View Profile Send Private Message to User Send Email to User Visit Homepage Show all user's posts High Scores This architect's holds Quote Reply
skell
Level: Legendary Smitemaster
Avatar
Rank Points: 3734
Registered: 12-28-2004
IP: Logged
icon Re: Various Scripting Improvements (+1)  
The docs for the "Face towards like guard" are the following:

Face towards like guard - Use this command to make the NPC change the direction they're facing towards a given point or entity just as the guard would.


+10 mod points to the person who can rewrite it to make it short and obvious how exactly it works :0.

____________________________
My website | Facebook | Twitter
07-26-2015 at 11:15 PM
View Profile Send Private Message to User Send Email to User Visit Homepage Show all user's posts High Scores This architect's holds Quote Reply
Nuntar
Level: Smitemaster
Avatar
Rank Points: 4576
Registered: 02-20-2007
IP: Logged
icon Re: Various Scripting Improvements (0)  
Face (or turn one step towards) the direction closest to the bearing from NPC to target.

____________________________
50th Skywatcher
07-26-2015 at 11:47 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: 872
Registered: 09-18-2006
IP: Logged
icon Re: Various Scripting Improvements (+2)  
Face towards like guard pretty much works as I would expect in 5.0.2. There's two unusual cases I found, both involve having an entity try to face towards like guard for the square it's already on.
Click here to view the secret text


[Last edited by bomber50 at 07-26-2015 11:50 PM]
07-26-2015 at 11:50 PM
View Profile Send Private Message to User Show all user's posts High Scores This architect's holds Quote Reply
skell
Level: Legendary Smitemaster
Avatar
Rank Points: 3734
Registered: 12-28-2004
IP: Logged
icon Re: Various Scripting Improvements (0)  
Nuntar wrote:
Face (or turn one step towards) the direction closest to the bearing from NPC to target.
It might be me but I don't understand, sorry :P.

____________________________
My website | Facebook | Twitter
07-26-2015 at 11:58 PM
View Profile Send Private Message to User Send Email to User Visit Homepage Show all user's posts High Scores This architect's holds Quote Reply
bomber50
Level: Smitemaster
Rank Points: 872
Registered: 09-18-2006
IP: Logged
icon Re: Various Scripting Improvements (0)  
Else if seems to work as expected.
07-27-2015 at 12:01 AM
View Profile Send Private Message to User Show all user's posts High Scores This architect's holds Quote Reply
skell
Level: Legendary Smitemaster
Avatar
Rank Points: 3734
Registered: 12-28-2004
IP: Logged
icon Re: Various Scripting Improvements (+3)  
Fixes in 5.0.2.1003:
- If the chosen target position is the NPCs position it no longer emits an assertion error.
- If the chosen target position is the NPCs position and you use this command as a condition for an if, it will always return true
- If you use this command inside an if statement it no longer stops the execution of the script on turn 0


____________________________
My website | Facebook | Twitter
07-27-2015 at 01:56 PM
View Profile Send Private Message to User Send Email to User Visit Homepage Show all user's posts High Scores This architect's holds Quote Reply
skell
Level: Legendary Smitemaster
Avatar
Rank Points: 3734
Registered: 12-28-2004
IP: Logged
icon Re: Various Scripting Improvements (0)  
Also Nuntar, I meant that unfortunately, at least I, couldn't really understand how it works from the description. This might be the problem with me so I'd appreciate feedback from others for that description.

____________________________
My website | Facebook | Twitter
07-27-2015 at 02:07 PM
View Profile Send Private Message to User Send Email to User Visit Homepage Show all user's posts High Scores This architect's holds Quote Reply
Jacob
Level: Smitemaster
Rank Points: 3741
Registered: 10-01-2004
IP: Logged
icon Re: Various Scripting Improvements (+1)  
Doesn't that mean: scripted character rotates (the way a guard/aumtlich would) in order to face a particular entity?

e.g. scripted character is facing east, Beethro is somewhere northwest of it. So scripted character rotates counterclockwise three times then stops.

Presumably the tie-breaks/borderline cases would be handled the same way as a guard or aumtlich would.

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

07-27-2015 at 03: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
bomber50
Level: Smitemaster
Rank Points: 872
Registered: 09-18-2006
IP: Logged
icon Re: Various Scripting Improvements (+1)  
Face towards like guard seems to work correctly. All 3 of the above issues fixed.
08-10-2015 at 09:25 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: 2668
Registered: 07-11-2014
IP: Logged
icon Re: Various Scripting Improvements (0)  
There is something wrong with Face Toward Like Guard.

I have the script inside a simple loop, so a character that just runs this every turn so he stays looking at the player. If, on a turn, it asks him to face the direction he is already looking at, the script halts execution and it no longer works.

The only thing I can think of here is that if using the command results in the character not changing the direction he faces, the command stops being a blocking command and does not wait until the next turn before continuing the script. This is triggering DRODscript's infinite loop protection by trying to to run the line more than once, and so the script gets KO'd.

Perhaps this should always be a blocking command?

Testing in 5.1.0.6345
01-14-2016 at 09:11 PM
View Profile Send Private Message to User Show all user's posts High Scores This architect's holds Quote Reply
skell
Level: Legendary Smitemaster
Avatar
Rank Points: 3734
Registered: 12-28-2004
IP: Logged
icon Re: Various Scripting Improvements (+1)  
I think that's consistent with the regular Face command which is no blocking if no action happens. It's a conflict between two things - actions are blocking if some action happens vs. ease of use of a scripting command. I'll need to ponder this.

____________________________
My website | Facebook | Twitter
01-14-2016 at 09:29 PM
View Profile Send Private Message to User Send Email to User Visit Homepage Show all user's posts High Scores This architect's holds Quote Reply
New Topic New Poll Post Reply
Caravel Forum : DROD Boards : Feature Requests : Various Scripting Improvements (Or: The 90's are over)
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.