STAR TREK 2d20
  1. #1
    Blackfoot's Avatar
    Join Date
    Oct 2010
    Location
    New Jersey, USA
    Posts
    4,202
    Blog Entries
    4

    Buttons no longer working...

    I had set up buttons for various equipment types.. armor.. weapons.. mirroring the 3.5 setup for my HERO System ruleset.. and they were working just fine.. now they give the following error..

    [ERROR] Script execution error: [string "C:masterindex_buttons:button_custom3"]:8: attempt to call field 'init' (a nil value)

    I'm not sure what I need to change to get this working again.
    I get this same error with my NPC buttons as well.
    Last edited by Blackfoot; October 8th, 2023 at 05:56.
    Full License Operator - You must have a 'Lite' License to play in my games.
    Member and GM in the Fantasy Grounds Pathfinder Society Group.
    PFS Fantasy Grounds Forum
    FG Community Teamspeak Server: ts.fg-con.com
    Interested in Custom Character Portraits and Tokens? Contact me.

  2. #2
    I'm not sure what "button_custom3" is, since it looks like your own template. You'll have to see what it is inheriting from.

    In the 3.5E ruleset, those templates look like this:
    Code:
    	<template name="button_npc_byletter">
    		<button_masterindex_option_view>
    			<recordtype>npc</recordtype>
    			<recordview>byletter</recordview>
    			<recordpath>reference.npcdatabyletter</recordpath>
    		</button_masterindex_option_view>
    	</template>
    Regards,
    JPG

  3. #3
    Blackfoot's Avatar
    Join Date
    Oct 2010
    Location
    New Jersey, USA
    Posts
    4,202
    Blog Entries
    4
    button_custom <number>
    is created by your code.. in masterindex_window.lua

    Code:
    function setupButtons()
    	local aIndexButtons = LibraryData.getIndexButtons(self.getRecordType());
    	if #aIndexButtons > 0 then
    		sub_buttons.setValue("masterindex_buttons", "");
    		for k,v in ipairs(aIndexButtons) do
    			sub_buttons.subwindow.createControl(v, "button_custom" .. k);
    		end
    	end
    
    	local aEditButtons = LibraryData.getEditButtons(self.getRecordType());
    	if #aEditButtons > 0 then
    		for k,v in ipairs(aEditButtons) do
    			local c = createControl(v, "button_edit" .. k);
    			if c then
    				c.setVisible(true);
    				table.insert(_tEditControls, c);
    			end
    		end
    	end
    end
    A CoreRPG thing.
    Full License Operator - You must have a 'Lite' License to play in my games.
    Member and GM in the Fantasy Grounds Pathfinder Society Group.
    PFS Fantasy Grounds Forum
    FG Community Teamspeak Server: ts.fg-con.com
    Interested in Custom Character Portraits and Tokens? Contact me.

  4. #4
    True, thanks for seeing that.

    However, none of the button templates in the CoreRPG ruleset have an "init" function, including the default template for those buttons. So, you must be passing a named template via aGMListButtons in the data library script for your ruleset that is defining scripts which are making an "init" function call.

    Here are the default templates for master index buttons from CoreRPG currently
    Code:
    	<template name="button_masterindex_option">
    		<button_text_sm>
    			<anchored to="buttonanchor" width="80">
    				<top />
    				<left anchor="right" relation="relative" offset="5" />
    			</anchored>
    		</button_text_sm>
    	</template>
    	<template name="button_masterindex_option_view">
    		<button_masterindex_option>
    			<script>
    				....
    			</script>
    		</button_masterindex_option>
    	</template>
    You should make sure that any templates that you are defining for master index buttons use one of those two templates. If view use the second one; otherwise, use the first and define onButtonPress/onDragStart events.

    Regards,
    JPG

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