5E Character Create Playlist
  1. #1

    Join Date
    Jun 2007
    Location
    Zeist, Netherlands
    Posts
    286

    Extension not working

    What am I doing wrong this time? I'm guessing it's in extension.xml, but I'll be damned if I know what it is....

    I created a new extension, copied characterlist.lua from the 3.5E ruleset to the scripts subfolder and added just 1 line, just to see if the extension is doing anything at all:

    Code:
    function onUserStateChange(username, statename, state)
    	print("Test");
    	if username ~= "" and User.getCurrentIdentity(username) then
    I never have Test show up in the console ever.....

    Here's extension.xml:
    Code:
    <?xml version="1.0" encoding="iso-8859-1"?>
    <root version="2.0" release="1">
    	<properties>
    		<name>Extension Test</name>
    		<version>1</version>
    		
    		<author>Nils van Schaik</author>
    		<description>3.5E ruleset test extension</description>
    		
    		<ruleset>
    			<name>3.5E</name>
    		</ruleset>
    	</properties>
    
    	<base>
    		<script file="scripts/characterlist.lua" />
    	</base>
    </root>
    I have succesfully created another extension that modifies chatmanager.lua, so I've got the basics down. Only difference I can find is that chatmanager.lua has a name attribute in the script tag, and characterlist.lua hasn't.

    Hope anyone can show me what I'm doing wrong.....

  2. #2

    Join Date
    Jun 2007
    Location
    Zeist, Netherlands
    Posts
    286
    Anyone? Please?

  3. #3
    Ikael's Avatar
    Join Date
    Jan 2008
    Location
    Finland/Joensuu
    Posts
    2,384
    first of all, onUserStateChange is handler function not even function. You need to define something the following the make it work:

    User.onUserStateChange = handleIt
    function handleIt(username, statename, state)
    -- content of the function
    end

    Secondly I think you are using that characterlist.lua in the characterlist window implementation. If this is the case you can't override it like you're doing. You must include the window implementation to your extension as well. On the otherhand if that function is global script you must give name to it so it will be initialized/created at all. For example:

    <script name="CharacterList" file="scripts/characterlist.lua" />

    Hope this helps!
    "Alright, you primitive screwheads, listen up: THIS... is my BOOMSTICK!" -- Ash Williams, Army of Darkness

    Post your SavageWorlds ruleset feature requests and issue reports here!

  4. #4

    Join Date
    Jun 2007
    Location
    Zeist, Netherlands
    Posts
    286
    Thanks for the tips,

    As I described, I took the file I want to change from the 3.5E ruleset and just added a line. I assume (can't check right now) that the assignment of onUserStateChange to handle an event is elsewhere in the 3.5E ruleset, and I haven't done anything with that.

    I'll try adding the xml that contains the reference to characterlist.lua to the extension, see if that works.

  5. #5
    You will need to replace the characterlist window class, which is where that script file is used.

    Copy the windowclass definition from desktop_classes.xml, into your extension.xml file. Then, put your new script file into a scripts subfolder under your extension's folder.

    Cheers,
    JPG

  6. #6

    Join Date
    Jun 2007
    Location
    Zeist, Netherlands
    Posts
    286
    Thanks guys, I now have a nice "Test" message showing up on my console. I can finally get started rebuilding my extension.

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
  •  
Starfinder Playlist

Log in

Log in