Announcement: Be excellent to each other.


Caravel Forum : DROD RPG Boards : RPG Feature Requests : Enemy location variables
New Topic New Poll Post Reply
Poster Message
Nuntar
Level: Smitemaster
Avatar
Rank Points: 4771
Registered: 02-20-2007
IP: Logged
icon Enemy location variables (+1)  
For a new RPG hold I've been planning, I'd like to be able to script certain magical attacks. This might be possible in the current engine, but it would be very difficult and time-consuming. So I came up with an idea that would make it much easier -- and would also have plenty of other applications.

The idea is this. You have variables "_EnemyX" and "_EnemyY", which function as parameters for the "_My" series of variables. So, for instance, this script:

Set var _EnemyX = 4
Set var _EnemyY = 7
Set var _MyHP = 50

would set the HP of the entity located at (4,7) to 50. (If no entity was located there, the last command would just be ignored.) These would be local variables, i.e. setting _EnemyX in one script doesn't change its value in another. It should (since there's no reason why not) be possible to change the stats of any entity: character, custom monster, default monster or player.

Possible uses:
* Magical attacks, e.g. an accessory that, when used, lowers the DEF of the individual enemy in front of the player. REP could be used as "magical points" to limit how many attacks you can fire. If the player had a variety of attacks available, this could drastically increase the range of optimisation choices.
* Creating custom snakes and rock giants.
* A script that takes action when a particular monster's HP falls below a threshold.
* Some functions that are already possible with current scripting would just be easier to script, e.g. changing monsters' stats in response to an event.

____________________________
50th Skywatcher

[Last edited by Nuntar at 12-21-2012 03:51 AM]
12-21-2012 at 03:46 AM
View Profile Send Private Message to User Show all user's posts High Scores This architect's holds Quote Reply
Someone Else
Level: Smitemaster
Avatar
Rank Points: 2347
Registered: 06-14-2005
IP: Logged
icon Re: Enemy location variables (0)  
That's a really good idea. But maybe it should just affect monsters and NPCs? Either that or it might be clearer as _TargetX, _TargetY, and a third command, something like 'UseTargetAsSelf'.
12-21-2012 at 07:12 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
Dischorran
Level: Smitemaster
Avatar
Rank Points: 3414
Registered: 09-10-2005
IP: Logged
icon Re: Enemy location variables (+1)  
Someone Else wrote:
That's a really good idea. But maybe it should just affect monsters and NPCs? Either that or it might be clearer as _TargetX, _TargetY, and a third command, something like 'UseTargetAsSelf'.
'UseTar,GetAss-Elf'

...sorry. I'll behave. -_-

____________________________
Click here to view the secret text

12-21-2012 at 08: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
Lucky Luc
Level: Smitemaster
Rank Points: 1215
Registered: 08-19-2012
IP: Logged
icon Re: Enemy location variables (0)  
Bumping this up because you can potentially do some very cool things with it. Or, in other words, I'd love to have it ;)

Note that this would be a generalization of this FR. While the linked command might be easier to use, with these variables you would be able to recreate all of its behavior.

Maybe there would also be something in between, or given that the implementation of this would probably make the implementation of the other one easier, add both of them? I'd be really happy about it :)
03-01-2016 at 02:09 PM
View Profile Send Private Message to User Show all user's posts This architect's holds Quote Reply
moldar
Level: Delver
Rank Points: 54
Registered: 02-13-2003
IP: Logged
icon Re: Enemy location variables (0)  
I have a hold that I have been working on for a few years - never enough time to polish and finish to my satisfaction.

However, in it, I do have a scripted magic wand with a few "upgrades" that can be earned.

If someone wants to see what I have made, feel free to reply here and I can shoot them a copy of what I have.

I don't want to do a general release yet, but this thread reminded me that I should get off my backside and do something :)
03-01-2016 at 04:33 PM
View Profile Send Private Message to User Show all user's posts Quote Reply
mrimer
Level: Legendary Smitemaster
Avatar
Rank Points: 5153
Registered: 02-04-2003
IP: Logged
icon Re: Enemy location variables (0)  
moldar wrote:
I have a hold that I have been working on for a few years - never enough time to polish and finish to my satisfaction.

However, in it, I do have a scripted magic wand with a few "upgrades" that can be earned.

If someone wants to see what I have made, feel free to reply here and I can shoot them a copy of what I have.

I don't want to do a general release yet, but this thread reminded me that I should get off my backside and do something :)
Whoa! You're back! Hi! Welcome back! :)

There's a new version of DROD RPG out with a lot of fixes and improvements, and on Steam too if you like that platform. It would be great if you'd like to work further on your hold. Was debating whether to have someone else continue working on it or not. Do you have any concrete plans that you'd be willing to share?

____________________________
Gandalf? Yes... That's what they used to call me.
Gandalf the Grey. That was my name.
I am Gandalf the White.
And I come back to you now at the turn of the tide.

[Last edited by mrimer at 03-01-2016 05:48 PM]
03-01-2016 at 05:47 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
moldar
Level: Delver
Rank Points: 54
Registered: 02-13-2003
IP: Logged
icon Re: Enemy location variables (0)  
mrimer wrote:
moldar wrote:
I have a hold that I have been working on for a few years - never enough time to polish and finish to my satisfaction.

However, in it, I do have a scripted magic wand with a few "upgrades" that can be earned.

If someone wants to see what I have made, feel free to reply here and I can shoot them a copy of what I have.

I don't want to do a general release yet, but this thread reminded me that I should get off my backside and do something :)
Whoa! You're back! Hi! Welcome back! :)

There's a new version of DROD RPG out with a lot of fixes and improvements, and on Steam too if you like that platform. It would be great if you'd like to work further on your hold. Was debating whether to have someone else continue working on it or not. Do you have any concrete plans that you'd be willing to share?

I did some additional scripting and some new "skills" as part of my Christmas break. I got a few local friends to test what I have so far, but since they aren't DROD RPG experts quite yet, the progress is slow.

I'd be open to partnering with someone to get this to completion.
03-01-2016 at 07:13 PM
View Profile Send Private Message to User Show all user's posts Quote Reply
kieranmillar
Level: Smitemaster
Rank Points: 2899
Registered: 07-11-2014
IP: Logged
icon Re: Enemy location variables (0)  
I'm happy to help you out with your hold, whether that be testing or helping to build it, or both!
03-01-2016 at 09:51 PM
View Profile Send Private Message to User Show all user's posts High Scores This architect's holds Quote Reply
Nuntar
Level: Smitemaster
Avatar
Rank Points: 4771
Registered: 02-20-2007
IP: Logged
icon Re: Enemy location variables (0)  
Me too :)

____________________________
50th Skywatcher
03-01-2016 at 10:05 PM
View Profile Send Private Message to User Show all user's posts High Scores This architect's holds Quote Reply
Someone Else
Level: Smitemaster
Avatar
Rank Points: 2347
Registered: 06-14-2005
IP: Logged
icon Re: Enemy location variables (0)  
I'm much more better at testing than building in RPG, but I also am open to that.

EDIT: Wow, apparently I'm much more worse at English.

[Last edited by Someone Else at 03-01-2016 10:39 PM]
03-01-2016 at 10:37 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
mrimer
Level: Legendary Smitemaster
Avatar
Rank Points: 5153
Registered: 02-04-2003
IP: Logged
icon Re: Enemy location variables (0)  
I would be very happy if you fine chaps help complete this hold. Actually, for me that would be a dream come true. :thumbsup

Moldar, can you invite them to your beta board?

____________________________
Gandalf? Yes... That's what they used to call me.
Gandalf the Grey. That was my name.
I am Gandalf the White.
And I come back to you now at the turn of the tide.

[Last edited by mrimer at 03-02-2016 03:51 AM]
03-02-2016 at 03:50 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
moldar
Level: Delver
Rank Points: 54
Registered: 02-13-2003
IP: Logged
icon Re: Enemy location variables (0)  
I had a beta board and somehow in my aging condition I lost it. I checked under the couch - no luck.

Perhaps Mr. Imer can assist me in getting that all set up again, at which point I will dust off this hold and get moving on it.
03-02-2016 at 03:26 PM
View Profile Send Private Message to User Show all user's posts Quote Reply
mrimer
Level: Legendary Smitemaster
Avatar
Rank Points: 5153
Registered: 02-04-2003
IP: Logged
icon Re: Enemy location variables (0)  
Ah, it's still there. Check under the "Hold Beta Testing" section at the bottom of the forum main page while logged in.

You can post your latest hold version there and invite others to the board.

____________________________
Gandalf? Yes... That's what they used to call me.
Gandalf the Grey. That was my name.
I am Gandalf the White.
And I come back to you now at the turn of the tide.

[Last edited by mrimer at 03-02-2016 03:41 PM]
03-02-2016 at 03:41 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
moldar
Level: Delver
Rank Points: 54
Registered: 02-13-2003
IP: Logged
icon Re: Enemy location variables (0)  
Invites sent to the three sturdy folks above.

Let's continue this in our super sekrit forum!
03-02-2016 at 03:51 PM
View Profile Send Private Message to User Show all user's posts Quote Reply
mrimer
Level: Legendary Smitemaster
Avatar
Rank Points: 5153
Registered: 02-04-2003
IP: Logged
icon Re: Enemy location variables (0)  
I have a portion of these use cases implemented in 1.3 via a new Set Monster Var script command:
Nuntar wrote:
* Creating custom snakes and rock giants.
* Some functions that are already possible with current scripting would just be easier to script, e.g. changing monsters' stats in response to an event.
I'll have to think a bit more about the way I want to manage querying the value of a monster attribute, in order to support the other use cases. Rather than setting multiple local variables, I'm thinking I'd probably want to add support for a variable query macro that can be written into expressions that performs the function you describe.

Something like "_EnemySTAT(x,y,stat enum)_", e.g., "_EnemySTAT(10,12,1)_". This expression would be interpolated to the value of the specific stat (e.g., 1 = ATK) for the entity at location (10,12), or 0 if no entity is at this location.

Then it could be used like this to reduce an enemy's defence by 1 (in pseudocode):

Set Monster Var (x,y) (DEF attribute) (_EnemySTAT(x,y,<DEF enum value>)_ - 1)



Supported stats:
0: HP
1: ATK
2: DEF
3: GR
4: REP

____________________________
Gandalf? Yes... That's what they used to call me.
Gandalf the Grey. That was my name.
I am Gandalf the White.
And I come back to you now at the turn of the tide.

[Last edited by mrimer at 11-23-2020 07:54 PM]
11-23-2020 at 07:42 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
hyperme
Level: Smitemaster
Avatar
Rank Points: 1180
Registered: 06-23-2006
IP: Logged
icon Re: Enemy location variables (+1)  
While the idea of functions in variable equations sounds tempting, I think it might be easier for most users if there was also a Get Monster Var command, that grabs a specified stat from a monster on a tile, and puts it in a _ReturnX variable.

____________________________
[Insert witty comment here]
Qzvlkx?
11-23-2020 at 08:55 PM
View Profile Send Private Message to User Show all user's posts High Scores This architect's holds Quote Reply
mrimer
Level: Legendary Smitemaster
Avatar
Rank Points: 5153
Registered: 02-04-2003
IP: Logged
icon Re: Enemy location variables (0)  
hyperme wrote:
While the idea of functions in variable equations sounds tempting, I think it might be easier for most users if there was also a Get Monster Var command, that grabs a specified stat from a monster on a tile, and puts it in a _ReturnX variable.
Good point. I thought of that too. I can see this might be an easier workflow for most users, but the direct approach here is simpler and definitely alluring. It's simple enough to provide an example in the help docs (which I'll do now).

I'll put up a PR and you can decide what you think.

Meanwhile, here's an example script I threw together that interpolates values a couple different ways.

The script itself isn't that interesting -- it waits for you to step on its location, and then it starts reducing an enemy's HP by 1 each turn -- but the concept is huge.
  Set var "x" = 9
  Set var "y" = 8
  Set var "stat" = 0
  Speech "HP = $_EnemySTAT(x, y, stat)$",Normal,Self,0,.
  Wait for player to touch me 
  Speech "Begin decreasing HP by 1 each turn",Normal,Self,1,.
Label loop
  Wait 0
  Set var "_MyScriptX" = x
  Set var "_MyScriptY" = y
  Set monster var HP,0,0,_EnemySTAT(_MyScriptX, _MyScriptY, stat) - 1
  Set var "_MyScriptX" = -9999
  Set var "_MyScriptY" = -9999
  Speech "HP = $_EnemySTAT(x, y, stat)$",Normal,Self,1,.
  Go to loop


____________________________
Gandalf? Yes... That's what they used to call me.
Gandalf the Grey. That was my name.
I am Gandalf the White.
And I come back to you now at the turn of the tide.

[Last edited by mrimer at 11-24-2020 12:37 AM]
11-24-2020 at 12:34 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
mrimer
Level: Legendary Smitemaster
Avatar
Rank Points: 5153
Registered: 02-04-2003
IP: Logged
icon Re: Enemy location variables (0)  
PR

Hyperme, please review, if you would.

Now that expression parsing support for primitives is in, it is super easy to add new primitives (see comment in PlayerStats.h for explanation).

____________________________
Gandalf? Yes... That's what they used to call me.
Gandalf the Grey. That was my name.
I am Gandalf the White.
And I come back to you now at the turn of the tide.

[Last edited by mrimer at 11-24-2020 12:51 AM]
11-24-2020 at 12:48 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
mrimer
Level: Legendary Smitemaster
Avatar
Rank Points: 5153
Registered: 02-04-2003
IP: Logged
icon Re: Enemy location variables (0)  
More primitives added!

PR

____________________________
Gandalf? Yes... That's what they used to call me.
Gandalf the Grey. That was my name.
I am Gandalf the White.
And I come back to you now at the turn of the tide.
11-24-2020 at 11: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
New Topic New Poll Post Reply
Caravel Forum : DROD RPG Boards : RPG Feature Requests : Enemy location variables
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.