Starfinder Playlist
Page 2 of 5 First 1234 ... Last
  1. #11
    Dakalin, pretty sure, yeah.

    Damned, as far as I know, I think you're right. I've been looking through extensions trying to find one with no luck. Honestly, I thought this would be easy, but it's proved deceptively difficult xp

  2. #12
    damned's Avatar
    Join Date
    Mar 2011
    Location
    Australia
    Posts
    26,656
    Blog Entries
    1
    Siggy442 in my experience it is most definitely NOT easy.
    For NPCs I suggest that you extend the existing Main Tab. You will need to work out how the Anchors work and are defined.
    Have a look at the Malestrom (community) ruleset - I have a bunch of different additions in there. A ruleset and an Extension are pretty similar.
    I could not work out the anchors so there are some kludges in terms of element positioning.


    FG Con 6 – April 17-19th 2015 - register at www.fg-con.com for all the latest info.

  3. #13
    I just went through the process to refresh my memory and created an extension you can use as an example. Here are the steps I used:
    1. Created a new windowclass that will represent the new tabs contents. I just copied npc_main and removed most of the fields.
    2. Copied the main subwindow_record and changed the <class> to match the windowclass I created above in step 1.
    3. Copied an existing tab in the <tabs_recordsheet>. Changed the <subwindow> to match the name of the new subwindow_record in step 2. Update the <icon> to match an existing icon that is defined in the ruleset or your extension. I used the tab_abilities.


    Hopefully it helps.

  4. #14
    That helped a lot. I was able to start creating the new tabs no problem. I've been doing a lot of tinkering and have managed to figure out a few more things. Since then, I've decided I was going to reorganize the way the NPC sheet was set up, so that I could have different menus on the main section. Thus, I started butchering some of the code... and now I'm running into an error I can't seem to get rid of.

    My Code for the setup of the general window:
    Code:
    	<windowclass name="npc">
    		<frame>recordsheet</frame>
    		<placement>
    			<size width="350" height="300" />
    		</placement>
    		<sizelimits>
    			<minimum width="350" height="300" />
    			<dynamic />
    		</sizelimits>
    		<minimize>minimized_npc</minimize>
    		<tooltip field="name" />
    		<nodelete />
    		<script>
    			function onInit()
    				onLockChanged();
    				DB.addHandler(DB.getPath(getDatabaseNode(), "locked"), "onUpdate", onLockChanged);
    			end
    			
    			function onClose()
    				DB.removeHandler(DB.getPath(getDatabaseNode(), "locked"), "onUpdate", onLockChanged);
    			end
    
    			function onLockChanged()
    				if header.subwindow then
    					header.subwindow.update();
    				end
    				if main.subwindow then
    					main.subwindow.update();
    				end
    
    				local bReadOnly = WindowManager.getReadOnlyState(getDatabaseNode());
    				notes.setReadOnly(bReadOnly);
    			end
    		</script>
    		<sheetdata>
    			<sub_record_header name="header">
    			<class>npc_header</class>
    			</sub_record_header>
    			
    			<subwindow name="main">
    				<bounds>0,65,-1,-20</bounds>
    				<class>npc_main</class>
    			</subwindow>
    			<subwindow name="abilities">
    				<bounds>0,65,-1,-20</bounds>
    				<class>npc_abilities</class>
    			</subwindow>
    			<subwindow name="notes">
    				<bounds>0,65,-1,-20</bounds>
    				<class>npc_notes</class>
    			</subwindow>
    
    			<scrollbar_record>
    				<target>main</target>
    			</scrollbar_record>
    			<scrollbar_record>
    				<target>abilities</target>
    			</scrollbar_record>
    			<scrollbar_record>
    				<target>notes</target>
    			</scrollbar_record>
    			
    			<tabs_recordsheet>
    				<tab>
    					<icon>tab_main</icon>
    					<subwindow>main</subwindow>
    				</tab>
    				<tab>
    					<icon>tab_abilities</icon>
    					<subwindow>abilities</subwindow>
    				</tab>
    				<tab>
    					<icon>tab_notes</icon>
    					<subwindow>notes</subwindow>
    				</tab>
    			</tabs_recordsheet>
    			
    			<resize_recordsheet />
    			<close_recordsheet />
    		</sheetdata>
    		
    	</windowclass>
    The errors are all control() anchoring to an undefined control(contentframe) in windowclass NPC. Except, I'm confused, because I don't have any contentframe referenced in my code. Everything I've tried removing and adding doesn't seem to get rid of these errors. At this rate, I'm thinking about just going back to the sheet the way it was as opposed to adding my own menus, though I would like to try and figure out these errors. This has been as much of a learning experience for understanding FG as anything xp
    Last edited by Siggy442; April 18th, 2015 at 23:20.

  5. #15
    damned's Avatar
    Join Date
    Mar 2011
    Location
    Australia
    Posts
    26,656
    Blog Entries
    1
    See post #12 above!

    I could not work out the anchors so there are some kludges in terms of element positioning.
    You really need to track down the anchoring and get your head around that. Use Notepad++ and use teh Find In Files feature and track down every instance of "names" until you find all the files that make up the element you are working on.

  6. #16
    Trenloe's Avatar
    Join Date
    May 2011
    Location
    Colorado, USA
    Posts
    33,362
    Quote Originally Posted by Siggy442 View Post
    The errors are all control() anchoring to an undefined control(contentframe) in windowclass NPC. Except, I'm confused, because I don't have any contentframe referenced in my code.
    The error is saying that it can't find contentframe so it makes sense that you don't have contentframe in your code, otherwise it would be able to be found.

    Controls templates used in the XML are set to anchor to a frame called "contentframe". Do a "find in files" in the base CoreRPG ruleset for contentframe to see where it usually is and you'll be able to put it back into your code. (Hint, look in campaign\record_npc.xml). The extension will overwrite code from CoreRPG - so your definition of <windowclass name="npc"> will overwrite the base CoreRPG definition of the same windowclass.
    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!

  7. #17
    Project [Relatively] Complete. After much trial and error, I decided to stick with what I knew I could edit confidently and make it as usable as possible. No graphics changes, but the game can now be used rather effortlessly with the DFRPG. Link to download is attached to the first page.

  8. #18
    damned's Avatar
    Join Date
    Mar 2011
    Location
    Australia
    Posts
    26,656
    Blog Entries
    1
    Hi Sigg442 - can you zip the files up - with the extension being in the base (eg dont zip up the parent folder) - and rename the file dfrpg.ext or similar?

  9. #19
    damned's Avatar
    Join Date
    Mar 2011
    Location
    Australia
    Posts
    26,656
    Blog Entries
    1
    Quote Originally Posted by damned View Post
    Hi Sigg442 - can you zip the files up - with the extension being in the base (eg dont zip up the parent folder) - and rename the file dfrpg.ext or similar?
    Ignore my dumb-*** comment! the web page showed the unpacked files - it is already a zipped up extension

  10. #20
    Ha, it's ago Damned. That threw me the first time I saw the files on a Google Drive, too.

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
  •  
FG Spreadshirt Swag

Log in

Log in