5E Product Walkthrough Playlist
Page 2 of 2 First 12
  1. #11
    Trenloe's Avatar
    Join Date
    May 2011
    Location
    Colorado, USA
    Posts
    33,413
    Quote Originally Posted by Kelendros78 View Post
    Ok so I had a great time learning lua and I have modded my 5e ruleset to out put when there is damage carrying over...do I need to give this ruleset to the players of my game? I don't see a way to make this an extension honestly since it goes straight to the core of the ruleset
    You don't need to give it to the players, they download the modified ruleset and cache it locally in the campaign data when they connect to you.

    You can easily make it an extension - the problem comes when the file/s you have modified get updated in a future version of the ruleset, you'll have to manually update your extension each time the file/s you modified change.

    Which functions (and in which files) did you modify?
    Private Messages: My inbox is forever filling up with PMs. Please don't send me PMs unless they are actually private/personal messages. General FG questions should be asked in the forums - don't be afraid, the FG community don't bite and you're giving everyone the chance to respond and learn!

  2. #12
    After looking at my post more closely I realized that I liked the warning after the damage message not in the middle of it...lol Attachment 8270 I want to take a moment and thank everyone here in the community you guys are amazing, thanks for the help. This to me seems like a simple fix for the Wild Shape being dropped by excessive damage, and now I have a clear cut way to assign damage to my player without having to go back through and re-figure up HP on the fly.

  3. #13
    I modified manager_action_damage.lua made nRemainder global, then used it in a conditional on line 1113 if rTarget and nRmainder> 0 ...then just concatnated to the string that was pre-existing...that way if there is !nRemainder then it doesn't show.

  4. #14
    So can I just make an extension of manager_action_damage.lua? that way I overwrite the ruleset when it updates?

  5. #15
    Trenloe's Avatar
    Join Date
    May 2011
    Location
    Colorado, USA
    Posts
    33,413
    Quote Originally Posted by Kelendros78 View Post
    So can I just make an extension of manager_action_damage.lua? that way I overwrite the ruleset when it updates?
    You can, but the problem is that new functionality, bug fixes, etc. can come in with a future release - other LUA scripts might rely on updated code in this file and if you don't update the extension to use the latest manager_action_damage.lua file you might well encounter issues.

    The best you can do is minimise the changes made to the file and have those changes in a minimum of places within the code - clearly comment your changes so you can find them in future and copy them into the new file in a future version. I also include a vanilla version of the file in the extension as well - call it perhaps manager_action_damage_5E_v309.lua as it is the vanilla file from 5E v309. Then when there are future releases of 5E you can compare this file with the latest manager_action_damage.lua, if there aren't any differences then you don't need to update the extension, if there are then you'd need to update your code into the latest version of manager_action_damage.lua. It's a pain doing this each time there is a new version released, but that's what we have to do...
    Private Messages: My inbox is forever filling up with PMs. Please don't send me PMs unless they are actually private/personal messages. General FG questions should be asked in the forums - don't be afraid, the FG community don't bite and you're giving everyone the chance to respond and learn!

  6. #16
    One last question. I modded my file and can't seem to get it back into a 5e.pak file...each time I try it errors out saying that it can't find the base.xml when I try to run it... any tips?

  7. #17
    Trenloe's Avatar
    Join Date
    May 2011
    Location
    Colorado, USA
    Posts
    33,413
    Quote Originally Posted by Kelendros78 View Post
    One last question. I modded my file and can't seem to get it back into a 5e.pak file...each time I try it errors out saying that it can't find the base.xml when I try to run it... any tips?
    Make sure you zip from within the 5E folder - i.e. select all of the files and sub-folders and zip them up as one zip file. Don't just highlight your modified 5E ruleset folder and zip from outside of the actual folder. It's case sensitive so use 5E not 5e. You'll then need to remove your 5E folder from the rulesets directory as a 5E folder will take priority over 5E.pak.

    Finally, be careful with doing this - if 5E is updated in future ad you run "Update" your modified 5E.pak will be overwritten. Hence it is best to do your modifications as an extension - but keep in mind the possible need to modify it in future if a later version of 5E has updates to the file/s you've used in the extension. You can PM me the modified code (or post it here) and I'll give you guidelines on how to minimise this work in future by putting it in an extension.

    All of the above is even more true if you're running in "dev" mode rather than live - there are frequent ruleset updates in "dev" mode that could either overwrite your 5E.pak file or cause errors with your modifications.
    Private Messages: My inbox is forever filling up with PMs. Please don't send me PMs unless they are actually private/personal messages. General FG questions should be asked in the forums - don't be afraid, the FG community don't bite and you're giving everyone the chance to respond and learn!

  8. #18

    Modded Code manager_action_damage.lua

    Code:
    	-- MODDED to output extra Damage done past total Hitpoints
    
    	if rTarget and nRemainder > 0 then
    		msgShort.text = msgShort.text .. " [to " .. rTarget.sName .. "]";
    		msgLong.text = msgLong.text .. " [to " .. rTarget.sName .. "] This Creature has sustained "..nRemainder.." damage beyond it's max HP";
    	elseif rTarget then
    		msgShort.text = msgShort.text .. " [to " .. rTarget.sName .. "]";
    		msgLong.text = msgLong.text .. " [to " .. rTarget.sName .. "]";
    	end
    This starts on line 1111 in my editor.
    I removed the local constraint on line 986 from nRemainder

  9. #19
    Trenloe's Avatar
    Join Date
    May 2011
    Location
    Colorado, USA
    Posts
    33,413
    Give this extension a try - run it against an unmodified 5E ruleset (i.e. the base v3.0.9 5E ruleset currently live).

    Note: as there were modifications in 2 functions, and one of the functions is very large, I didn't split these two functions off into a separate script file - I left them in the complete 5E manager_action_damage.lua file. This will make it easier to spot changes to these functions in future and keep this extensions up to date with version upgrades.
    Private Messages: My inbox is forever filling up with PMs. Please don't send me PMs unless they are actually private/personal messages. General FG questions should be asked in the forums - don't be afraid, the FG community don't bite and you're giving everyone the chance to respond and learn!

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
DICE PACKS BUNDLE

Log in

Log in