PDA

View Full Version : Implementing a CT under CoreRPG



S Ferguson
March 8th, 2015, 22:26
I'm building a homebrewed system for an infamous '90's game I've recently rediscovered, and have got all the pieces into place except for the combat tracker (well that's not necessarily true: I have a CT window, and the ability to add entries).

CoreRPG allots for targeting, but for some reason, it's only working one way from the character to the target (I'm at the end of my programming rope here). I've isolated one of the problems to "how do you pull the Target's information, such as the name of the hostile, from the CT?"

The CT in any system is a complex beast, and a few helpful pointers would be much appreciated. I'm specifically interested in damage management, scripting, Managers, token to token targeting (which, as I've noted seems to be only working one way for me), and retrieving specific information from the tracker itself. Actually, any related information pertaining to developing a concrete tracker would be much appreciated - example code that isn't related to any of the published rulesets (they require too much unraveling before becoming coding useful). Pseudo-code generic to Core, or well documented Core cases, would be preferable. If you have any questions I'd like to hear those too, as I'm sure this is a problem with most projects for beginners working over the CoreRPG "rules."

Regards,
SF

damned
March 9th, 2015, 01:16
Id love to latch onto this thread.
The MoreCore extension has a couple of new upgrades over the weekend and Id like to get targeting working.
And once that is finished Im going back to Paranoia and that would be nice to have a full combat system... but at this stage its too advanced for me!



https://www.fg-con.com/wp-content/uploads/2015/01/fg-con-6-150-8.jpg (https://www.fg-con.com/events/)
FG Con 6 – April 17-19th 2015 - register at www.fg-con.com (https://www.fg-con.com/) for all the latest info.

Trenloe
March 9th, 2015, 01:56
Have a look at scripts\manager_actions.lua in CoreRPG. The key thing to understand with CoreRPG actions is that an action has an rActor record (see the comments at the top of scripts\manager_actor.lua for info on what is in this record) and an action can also have none, one or many targets which can be stored in a rTarget record or an aTargets table (for multiple targets).

Have a look in CoreRPG scripts\manager_actions.lua - you'll see rTarget appear a few times - usually when something is being done against a single target, e.g. a drop action or a single action being resolved during an action with one or more targets (stored in a table called aTargets, usually). Remember that the code in manager_actions.lua is resolving actions (dice rolls, etc.).

The actions don't mean much in CoreRPG as there isn't any automation coded into this ruleset (as, to start with, there aren't even any statistics!), so you won't see any specific action examples in CoreRPG, just the underlying logic that is used by rulesets that layer on top of CoreRPG. Sorry, but there's not an easy way around it, if you want examples of targeting automation you're going to have to look at a ruleset that is layered on top of CoreRPG. Have a look at manager_action_heal.lua in the 3.5e ruleset as a simpler example than others. This does a bunch of coding in modHeal and onHeal to work out the actual healing value, and then this is applied to an rTarget using ActionDamage.notifyApplyDamage - one of the first things this code does is get the type and dbnode of the rTarget record using local sTargetType, sTargetNode = ActorManager.getTypeAndNodeName(rTarget); once you have this info you can work out if it is a PC or and NPC (sTargetType) and also get access to all of the database info for the target via sTargetNode.

manager_targeting.lua in CoreRPG has some helper functions that you might find useful - for example, getFullTargets(rActor) returns a table (aTargets) that contains a list of rTarget records that rActor is currently targeting - this can be very handy to give you a list of all of the targets for a specific creature. The rActor record includes references to the database entry and combat tracker entry for the creature in question, so you can get just about any info you want about the initiator of the action.

S Ferguson
March 9th, 2015, 03:23
Thanks for the tips. I owe you another.

However, there has to be a means of flowcharting the overlying CT with the logic in the managers in CoreRPG. En Gratis: CT's in most gaming systems since the '80's (bar a few) have Initiative, Attack, Damage calculations, Die rolls, Modifiers, Health Rating and other "gloss" (for lack of a better term - this can be as complicated as RMC or as "simple" as C&C, and all points in between). The generic Initiative, Attack, Damage, Health Metric and how they relates to the logic of the helper functions provided in CoreRPG would be a classic time saver, as you would know what functions to call, where and when - it could even include regular happenstance, like Rolls (generic, not specific).

I've studied the functions in Core, but as you mentioned there is just cold logic. I also note that a lot of the time half of these functions are overwritten with custom code for the particular ruleset. What to override and when is also a concern of mine. I take the modernist view that if it isn't broken, tinker with it a little (as opposed to the classist view that if it isn't broken don't fix it, and the post-modern view of if it isn't broke - break it) only here, you tend to find yourself high and dry. The general concepts remain the same; it's the execution that differs.

If the general flow of a CT in these basic terms could be formulated in a flowchart, I'd probably find it a lot easier to follow. The ontology of die driven RPGs (and some LARPs) is small and doesn't really change much, (I think there are about 6 candidate models) - once you have the statistics to pump into the sump tank. the CT could be flushed out in rough in a few hours, ready to accept whatever it is you want it to do.

Targeting, I do agree is one of those things you have a lot of leeway with under Core. Still, a guide to the major functions provided, would be a boon. I had no idea, for example that aTarget was actually an array of targeted individuals. All of this, if enough input from the community with experience in building CT's, came to fruition, the layered ruleset as a construct would be far easier to manage. I'm not saying I don't like to get my hands dirty in the programming, but a jumping off point would at least secure me (and probably a few more people) and the bungie-cord to the cliff.:)

Cheers,
SF

ianmward
March 9th, 2015, 08:53
En Gratis: CT's in most gaming systems since the '80's (bar a few) have Initiative, Attack, Damage calculations, Die rolls, Modifiers, Health Rating and other "gloss"
Hey Damned... I think he wants the MoreCore extension.

S Ferguson
March 9th, 2015, 15:13
Yes. That was a help. I have no Idea how to incorporate it into a ruleset, but the "guts" are there to exploit, as soon as I figure out a way to tie it in to this system, I'll be home free. Any advice on how to add MoreCore's functionality into a ruleset?

Cheers,
SF

damned
March 10th, 2015, 00:54
To use MoreCore as a Ruleset you pretty much change the reference.xml to a base.xml file including this and a few other small changes.


<!-- Attributes -->
<description>
<text>Paranoia</text>
<author>West End Games, Mongoose Publishing</author>
<website></website>
</description>
<importinfo>
<acceptfrom ruleset="Paranoia" />
</importinfo>

<!-- Layers -->
<importruleset source="CoreRPG" />

and when you zip it up do it as a PAK instead of an EXT

There isnt a whole lot of difference except that the ruleset tends to have LOADS more changes than an Extension.


https://www.fg-con.com/wp-content/uploads/2015/01/fg-con-6-150-9.jpg (https://www.fg-con.com/events/)
FG Con 6 – April 17-19th 2015 - register at www.fg-con.com (https://www.fg-con.com/) for all the latest info.

S Ferguson
March 10th, 2015, 01:04
Loads and loads in fact. That's why I'd encourage other developers to leave tidbits of wisdom on incorporating a CT into a ruleset. The Documentation on the Wiki needs something on this. m Perhaps even a video (ick!) could be made. Maybe, I'm becoming delusional just looking at different implementations and not seeing the big picture. Ahhh... that's what I need. The "Big Picture" of how this puzzle piece fits into the ruleset in a seamless way.

Cheers,
SF

damned
March 10th, 2015, 02:35
Loads and loads in fact. That's why I'd encourage other developers to leave tidbits of wisdom on incorporating a CT into a ruleset. The Documentation on the Wiki needs something on this. m Perhaps even a video (ick!) could be made. Maybe, I'm becoming delusional just looking at different implementations and not seeing the big picture. Ahhh... that's what I need. The "Big Picture" of how this puzzle piece fits into the ruleset in a seamless way.

it wont help you with a full CT implementation - yet - but v0.6 will have plenty of comments and pointers and explanations... 0.5 has about half of the commentary init.



https://www.fg-con.com/wp-content/uploads/2015/01/fg-con-6-150-10.jpg (https://www.fg-con.com/events/)
FG Con 6 – April 17-19th 2015 - register at www.fg-con.com (https://www.fg-con.com/) for all the latest info.

S Ferguson
March 10th, 2015, 02:40
I'll be looking forward to it...

Cheers,
SF

S Ferguson
March 12th, 2015, 01:41
Trenloe, (or anyone else who knows the answer to this one), what is the precise syntax of calling the functions from the targeting manager? I tried the usual TargetingManager.getFullTargets() but it doesn't recognize it saying that the function isn't global. I was under the impression that the scope of the Managers were global, not local, and that you could access the function with the dot routine. Am I doing something wrong?

Trenloe
March 12th, 2015, 03:18
Look in the base.xml file in the root of the ruleset/s involved (including CoreRPG). There will be a <script> definition for the LUA file in question - this will give name="XXXXXX" where XXXXXXX is the name of the global script package to use. The use <Global package name>.<global package function name> to call it - remember to get case sensitivity right.

Be careful where you call this - if you have it in onInit code then it might be that the global package hasn't been built yet.

S Ferguson
March 12th, 2015, 03:20
Thanks.

SF

EDIT: I've tried incorporating the CoreRPG into the base as "TargetingManager". When I make the call, (not onInit() ) I still get the same result of not having a global function available. The case sensitivity is correct. The results, however, aren't.