Results 1 to 5 of 5

Thread: handler for events

  1. #1
    Banned
    Join Date
    May 2010
    Location
    fuck off?
    Posts
    1,145

    Default handler for events

    everyone seems to be using their own event handler right now,

    for spawn events in AP I had a handler you could reigster your script with, no one ever used it but it was there.

    so a file which just ececutes all scripts on an event...


    or is there plans to support multiple registers?

  2. #2
    Developer Sor's Avatar
    Join Date
    Aug 2010
    Location
    The Medieval City of Bruges
    Posts
    747

    Default

    That sounds reasonable. I don't think there needs to be any engine side support if we do it this way. It's just that each script which uses reborn events will have to adopt to this.
    Fortunately, those aren't many.

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

    Default

    I don't have any plans to allow multiple events of the same type to be registered. What we were after with armageddon was creating ModLoader, which would load all mods and execute their routines in framework registered events. I'm sure you remember Elgan that we talked about it.

    Here is the thread:
    http://www.x-null.net/forums/showthr...d-1-12-modding

    Each mod would need to have .ini file that our framework would parse, and load settings.
    Example case:

    MyAwesomeMod.pk3
    MyAwesomeMod.ini

    Code:
    [description]
    name=MyAwesomeMod
    author=RazoRapiD
    version=1.0
    description=""
    
    [events]
    spawn=myawesomemod/events.scr::spawn
    connect=myawesomemod/events.scr::connect
    precache=myawesomemod/dmprecache.scr
    
    [misc]
    whatever
    Now our framework parses files from the list that the engine will provide (or with functions that engine will provide)
    It registers it's own events, and does something like:

    Code:
    spawn local.player:
    
         for(local.i = 0; local.i < local.spawn_events.size; local.i++)
               waitexec local.spawn_events local.player
    end
    This way mods won't need to touch the core events and won't create conflicts.
    We can even make additional checks, so for example, if player is NIL or NULL don't execute the events, so it saves time and so on.

  4. #4
    Banned
    Join Date
    May 2010
    Location
    fuck off?
    Posts
    1,145

    Default

    oh yeah! hehe sounds good.

    can the ini be inside the pk3?

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

    Default

    I'd need to create additional scripting command to open file from pak file. But this should be possible.

Posting Permissions

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