-
September 1st, 2021, 03:34 #1
An old extension I made is being resurrected
BUT... there is one problem! My extension no longer appears in my extension list at the campaign selection. Below is my extension.xml code:
Code:<?xml version="1.0" encoding="iso-8859-1"?> <root version="3.0" > <properties> <name>*5E - Complete Offensive Package* </name> <version>0.04</version> <author>Lord Taser</author> <ruleset> <name>5E</name> </ruleset> </properties> <announcement text="Complete Offensive Package v0.04 for FGU V3.3.6A 5E ruleset." font="emotefont" icon="LT" /> <base> <!-- Modified Files --> <includefile source="campaign/record_char_weapon.xml"/> <includefile source="campaign/campaign_chars.xml"/> <!-- Define Managers --> <script name="cop" file="scripts/effects.lua"/> <!-- Define Images --> <icon name="LT" file="graphics/icons/Lord Taser.png"/> </base> </root>
Last edited by MyGivinOpinion; September 1st, 2021 at 03:38.
FG License: Unity Ultimate License
Timezone: -5 EST/EDT
-
September 1st, 2021, 04:21 #2
Supreme Deity
- Join Date
- Mar 2007
- Posts
- 20,559
We will need to see the complete extension in order to figure out what is wrong (i.e. .ext file or folder zipped up)
Regards,
JPG
-
September 1st, 2021, 04:29 #3
edited
Last edited by MyGivinOpinion; September 1st, 2021 at 20:39.
FG License: Unity Ultimate License
Timezone: -5 EST/EDT
-
September 1st, 2021, 06:09 #4
Supreme Deity
- Join Date
- Mar 2007
- Posts
- 20,559
That file is a renamed RAR file; not a renamed ZIP file. FG does not read RAR format.
Make sure to create it using the ZIP format. (The Windows "Send To -> Compressed File" right click option will do that, and that's what I use.)
Regards,
JPG
-
September 1st, 2021, 20:44 #5
I've uninstalled WinRAR. That fixed the issue.
The original issue that caused me to stop was an OOB error, and I'm guessing that is still what is causing my issues. The extension works as intended for the GM only, and only half works for the player. When the extension goes to clear a threat range indicator, it gives the following error for the player to the console:
Attachment 48977
Compared to the GM side:
Attachment 48978
and for the code:
Code:function onInit() user = User.getUsername(); --assigns user login name currently useless OOBManager.registerOOBMsgHandler(OOB_MSGTYPE_MELEE, onMelee); OOBManager.registerOOBMsgHandler(OOB_MSGTYPE_REACH, onReach); OOBManager.registerOOBMsgHandler(OOB_MSGTYPE_CLEAR, clearReach); end function customOOBHandler(msgOOB, funct) Comm.deliverOOBMessage(msgOOB, funct); end function getCharID(CharID) charNode = CharID; --assigns charsheet.id-##### PCName = DB.getValue(charNode,"name"); --assigns the PC Name end --sorts weapon properties and handles property triggers. function propertySorter(aWeaponProps) Debug.console("userName:: ", user); --userName Debug.console("charNode:: ", charNode); --charsheet.id-***** Debug.console("PCName:: ", PCName); --PCName Debug.console("aWeaponProps:: ", aWeaponProps); --{ #1 = s'*******', #2 = s'*******', etc... } weapon properties returned from record_char_weapon.xml for index, value in ipairs(aWeaponProps) do --Debug.console(value); --prints the individual properties listed in aWeaponProps if value == "reach" then CTVerification(); --grab CT info and assign variables msgOOB.type = OOB_MSGTYPE_REACH; customOOBHandler(msgOOB, ""); onReach(); --function that applies changes to threat range indicator else CTVerification(); msgOOB.type = OOB_MSGTYPE_MELEE; customOOBHandler(msgOOB, ""); onMelee(); end end end --Tracks down the Token by comparing charsheet.id-##### in both the combattracker and charsheet DB's function CTVerification() local idNodes = CombatManager.getCombatantNodes(); --{ s'id-*****' = databasenode = {combattracker.list.id-***** }, s'id-*****' = databasenode = {combattracker.list.id-***** }} Debug.console(idNodes); for i, v in pairs(idNodes) do --for-loop to break up the idNodes into single scannable tables local CTName = DB.getValue(v, "name"); if PCName == CTName then Debug.console("CTName:: ", CTName); CTLID = v; --assigns CTLID the list id-##### if the Names on the list and character sheet match Debug.console("CTLID:: ", CTLID); msgOOB.tokenpath = CTLID; else end end end --Applies COP Threat Range Effect to normal melee attack(currently handles ranged attacks by default) function onMelee() local nDU = GameSystem.getDistanceUnitsPerGrid(); local nSpace = math.ceil(DB.getValue(CTLID, "space", nDU) / nDU); local nHalfSpace = nSpace / 2; local nReach = math.ceil(DB.getValue(CTLID, "reach", nDU) / nDU) + nHalfSpace; local tokenpath = msgOOB.tokenpath; tokenCT = CombatManager.getTokenFromCT(tokenpath); Debug.console("tokenCT:: ", tokenCT); --displays tokeninstance data tokenCT.removeAllUnderlays(); tokenCT.addUnderlay(nReach, "4fB22222", ""); end
Last edited by MyGivinOpinion; September 1st, 2021 at 21:25. Reason: Clarification
FG License: Unity Ultimate License
Timezone: -5 EST/EDT
-
September 1st, 2021, 21:06 #6
Supreme Deity
- Join Date
- Mar 2007
- Posts
- 20,559
Your best bet is to work backwards through each function and output the parameters being passed in. It seems like somewhere that your variables aren't set the way you expect.
For example, you are using "nodeWin" in your getCharID function, but that variable is not defined anywhere so will always be nil.
Regards,
JPG
-
September 1st, 2021, 21:23 #7
*deleted*
Last edited by MyGivinOpinion; September 1st, 2021 at 21:40. Reason: duplicate message
FG License: Unity Ultimate License
Timezone: -5 EST/EDT
-
September 1st, 2021, 21:39 #8
Thanks for pointing that out, something I forgot to delete before posting the code. It's not meant for this code. Do I need a User.isHost() check? And if so, how and/or where would I implement it? It also seems that the players can't access info from the CT such as token instance information. I believe this is mainly where my OOB statement should go, but I am not sure as to how it is used. I've reviewed the ref doc, and talked to others more familiar with it.
FG License: Unity Ultimate License
Timezone: -5 EST/EDT
-
September 3rd, 2021, 13:23 #9
So I have had tremendous success with programming my extension, but in my haste I forgot to change my map grid back to square. Coding wise this makes little difference for the underlay, but is there a way to alter the shape of a square underlay so that it is rounded like on the hex grid? I only discovered this feature yesterday and really hope to make full use of it.
FG License: Unity Ultimate License
Timezone: -5 EST/EDT
-
September 4th, 2021, 15:11 #10
So i went forward and broke my program, had to rewind to a previous version. Discovery of problem relating to FGU not detecting current User's token. No error messages are being thrown so I know the code itself is solid. I just need to figure out a way to keep track of who is mousing over what character sheet and tell the appropriate token to update. Anyone have any ideas on where to start looking? Attached is my current code. (Please use Hex grid as this is the unintended best grid setting for the extension.)
COP.extFG License: Unity Ultimate License
Timezone: -5 EST/EDT
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks