Results 1 to 5 of 5

Thread: Register Event fix for duplicate Scripts

  1. #1
    Developer RyBack's Avatar
    Join Date
    Apr 2014
    Location
    In Front of the screen
    Posts
    1,603

    Arrow Register Event fix for duplicate Scripts

    Hi.

    here is the idea :
    the return value of registerev shouldn't be 1 if it's already registered . it should be 1and the location of the file/thread it's registered to .
    eg .

    local.result = registerev "connected" ThisScriptPath.scr::connected
    if(local.result[0])
    {
    local.OtherThreadPath = local.result[1]
    local.result = unregisterev "connected"
    local.result = registerev "connected" ThisScriptPath.scr::connected local.OtherThreadPath
    }
    end
    connected local.player local.otherthread:
    if(local.otherthread )
    thread local.otherthread local.player
    // script here
    end

    so the idea is to return where the other thread that the event is registered to and unregister the event then register it to our thread and from our thread we execute the other thread . hope someone got the idea

  2. #2
    Purple Developer Purple Elephant1au's Avatar
    Join Date
    Feb 2012
    Location
    Australia
    Posts
    1,269

    Default

    My EventHandler implements fixes for things like this, it allows multiple scripts to be assigned to each event, either with a simple place in correct folder or a register thread, it also includes a feedback system which shows which scripts are registered for which events.

    Purple's Playground
    OBJ :
    103.29.85.127:12203
    xfire: purpleelephant1au
    email: purpleelephant1au@gmail.com
    skydrive: PurpleElephantSkydrive




  3. #3
    Developer RyBack's Avatar
    Join Date
    Apr 2014
    Location
    In Front of the screen
    Posts
    1,603

    Default

    Quote Originally Posted by Purple Elephant1au View Post
    My EventHandler implements fixes for things like this, it allows multiple scripts to be assigned to each event, either with a simple place in correct folder or a register thread, it also includes a feedback system which shows which scripts are registered for which events.
    then it must be added to reborn pk3 , as stock reborn pk3 , I know the idea of ur mod but we needa fix the command itself , not all modders use it

  4. #4
    Über Prodigy & Developer Razo[R]apiD's Avatar
    Join Date
    May 2010
    Location
    Poland, Lublin
    Posts
    3,257

    Default

    Command is not broken so it doesn't need a fix. What Purple did, is he created a wrapper, or facade (you name it), which extends the standard API.

    Bad idea is to let the mod know where other event was registered and allow mods to unregister not their own handlers.

    Mod Framework is in the works, and will support higher level of abstraction for underlying API.


    EDIT:

    By the way you can already do this with new scripting functions, which really shows their POWER:

    You can list all PK3 files
    You can list all .scr files which are not in standard paks
    You can open each of them
    You can search for registerev and parse the text
    You can implement what you wanted

    I'm not sure if it's worth it, and I'm sure it's a bad idea.

  5. #5
    Developer RyBack's Avatar
    Join Date
    Apr 2014
    Location
    In Front of the screen
    Posts
    1,603

    Default

    k :v
    lol

Posting Permissions

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