Welcome, guest! Please login or register.

    * Shoutbox

    RefreshHistory
    • Shady Aftermath: Skyfire317, The Only Server With Warding,Divination,Archaeology, AFK Auto Upgrade [link]
      July 09, 2020, 12:09:03 AM
    • Shady Aftermath: Skyfire317, The Only Server With Warding,Divination,Archaeology, AFK Auto Upgrade [link]
      July 09, 2020, 12:08:59 AM
    • Shady Aftermath: Skyfire317, The Only Server With Warding,Divination,Archaeology, AFK Auto Upgrade [link]
      July 09, 2020, 12:08:51 AM
    • demon dylan: anyone know moparscape call back link?
      July 08, 2020, 07:02:51 PM
    • ragnoroker: Brand new server! Less than 1 week old! Nightmare/Raids 1/2/Hydra/Pk Modes/Exp modes/ Unique  Join today - [link]
      July 04, 2020, 06:42:38 PM
    • ragnoroker: Brand new server! Less than 1 week old! Nightmare/Raids 1/2/Hydra/Pk Modes/Exp modes/ Unique  Join today - [link]
      July 04, 2020, 06:42:32 PM
    • iddsyou: PkOwnage 2 worlds, modern OSRS & 2014 server! [link]  Join us on Discord! [link]
      July 04, 2020, 11:07:29 AM
    • slayerpure: kingdom full blown custom server with over 50 custom bosses released last week. play now here     [link]
      July 02, 2020, 08:44:32 PM
    • jgoet: dodian !!
      July 02, 2020, 07:15:44 PM
    • jgoet: join [link]  its back online !!!!
      July 02, 2020, 07:15:37 PM
    • Protojae: RIP moparscape
      July 02, 2020, 03:01:32 PM
    • Protojae: obviously thiswebsite is dead as fudge
      July 02, 2020, 03:01:14 PM
    • ragnoroker: RuneGuild has just been released! 1 Hour old, Come join the fun - [link]
      June 26, 2020, 02:14:21 PM
    • ragnoroker: RuneGuild has just been released! 1 Hour old, Come join the fun - [link]
      June 26, 2020, 02:14:08 PM
    • ragnoroker: RuneGuild has just been released! 1 Hour old, Come join the fun - [link]
      June 26, 2020, 02:14:00 PM
    • Fox2007: rune-nexus.com - FREE advertising, SEO optimized - no registration required
      June 26, 2020, 06:21:47 AM
    • Decimate Returns: trailer video posted for Project Decimate, Official Launch is in a few weeks! watch here: [youtube]LBorsdI-k1Y[/youtube]
      June 24, 2020, 07:18:03 PM
    • slayerpure: 1 week old rsps we need players and potential staff, customs and goku/vegeta sets play here!    [link] join our discord [link]
      June 24, 2020, 05:23:46 PM
    • Decimate Returns: Project Decimate is still in BETA: join our discord to keep up with the new content added: [link]
      June 24, 2020, 01:09:23 PM
    • Decimate Returns: Project Decimate is still in BETA: join our discord to keep up with the new content added: [link]
      June 24, 2020, 01:09:03 PM

    Author Topic: API Reference Guide  (Read 2448 times)

    0 Members and 1 Guest are viewing this topic.

    Offlinesini

    • Member
    • ****
    • *
    • *
    • Posts: 5,785
    • Thanks: +0/-0
      • View Profile
    API Reference Guide
    « on: August 03, 2015, 07:21:20 PM »
    WIP as of 8/3/2015, methods listed are final.

    Java Modules

    - World

    Lua Modules

    World

    CreateObject(plane, x, y, type, config, orientation)
    UpdateObject(plane, x, y, type, config, orientation)

    Creates a new game object at the specified coordinate. Note that if an object already exists at the specified coordinates for the object group with the provided type then the object is updated. UpdateObject is an alias for CreateObject. Both methods are provided to give clarity to users and a distinction for intended purpose.

    Example:

    Code: Lua
    1. -- Spawns a tree at coordinates [0, 3222, 3222], using the type identity of a prop, facing north
    2. world:CreateObject(0,32223222, obj.prop, obj.tree, obj.north)
    3.  
    4. -- Equivalent code
    5. world:UpdateObject(0,32223222, obj.prop, obj.tree, obj.north)
    6.  

    Java Models

    Mobile

    InteractWith(object, distance, closure)
    InteractWith(object, closure)

    Interacts with an entity. The provided closure will be triggered when the following conditions are met:

    1). There is a line of sight between the mobile and the target.
    2). The distance between the mobile and the target is less or equal to the specified distance.

    If the mobile is interacting with another mobile entity the mobile will attempt to walk to the mobile to trigger the required conditions. This is done via appending a way point to the entities nearest adjacent position. If the mobile is interacting with an immobile entity, the mobile will make no attempt to walk to the immobile entity and the expected behavior is for a route to the immobile entity to either be predetermined, calculated, or provided from the client. If there are no pending way points or steps when the target is a game object, and the mobile entities interaction condition is not met the interaction is considered a failure and the mobile entity will stop attempting to interact with the immobile entity.

    Examples:

    Code: Lua
    1. local player = SomeMoreCodeHere()
    2. local object = SomeCodeHere()
    3. player:InteractWith(object,function(player) player:Print('I am adjacent to the object!')end)
    4.  
    « Last Edit: August 10, 2015, 04:50:15 AM by sini »
    Runescape Gambling

    OfflineCres

    • Member
    • ****
    • Posts: 1,392
    • Thanks: +0/-0
      • View Profile
    Re: API Reference Guide
    « Reply #1 on: August 04, 2015, 06:18:19 AM »
    Will things such as ground items, npcs, etc all be handled through the World module? And is this some sort of RuneScript placeholder?
    And I can find myself alone with just my thoughts
    As time crumbles away

    Avenged Sevenfold - Darkness Sourrounding

    Offlinesini

    • Member
    • ****
    • *
    • *
    • Posts: 5,785
    • Thanks: +0/-0
      • View Profile
    Re: API Reference Guide
    « Reply #2 on: August 10, 2015, 04:49:47 AM »
    Updated to include information about InteractWith(...)

    OfflineSupaz

    • Member
    • **
    • Posts: 59
    • Thanks: +0/-0
      • View Profile
      • Rune-Server.ee
    Re: API Reference Guide
    « Reply #3 on: August 12, 2015, 03:57:50 AM »
    You'll need a TON more information that's VERY specific to enable the novice level programmers to even start to comprehend the systems you use. Other than that, Like I said in IRC Lemme know when I can start writing content scripts!! You're taking forever :(
    This forum sucks now.

    OfflineRyley

    • Member
    • ****
    • *
    • Posts: 7,315
    • Thanks: +0/-0
      • View Profile
    Re: API Reference Guide
    « Reply #4 on: August 12, 2015, 01:54:55 PM »
    I would appreciate half-decent documentation in the codebase. Almost all of your documentation throughout is half-assed, either document of don't.

    Offlinesini

    • Member
    • ****
    • *
    • *
    • Posts: 5,785
    • Thanks: +0/-0
      • View Profile
    Re: API Reference Guide
    « Reply #5 on: August 12, 2015, 03:17:20 PM »
    Cause I rushed much of it?

    OfflineRyley

    • Member
    • ****
    • *
    • Posts: 7,315
    • Thanks: +0/-0
      • View Profile
    Re: API Reference Guide
    « Reply #6 on: August 12, 2015, 03:19:37 PM »
    Cause I rushed much of it?

    Didn't mean to sound dick-ish, but it is just really annoying to see stuff like this:

    Code: [Select]
        /**
         *
         * @param alloc
         * @param outgoingPackets
         * @param message
         */

    Offlinesini

    • Member
    • ****
    • *
    • *
    • Posts: 5,785
    • Thanks: +0/-0
      • View Profile
    Re: API Reference Guide
    « Reply #7 on: August 12, 2015, 03:25:02 PM »
    The amount of time wasted writing comments for everything is massive especially in large projects such as this. Which is why I stated, in my posts, that its slated for AFTER when I finish the core features.

    OfflineRyley

    • Member
    • ****
    • *
    • Posts: 7,315
    • Thanks: +0/-0
      • View Profile
    Re: API Reference Guide
    « Reply #8 on: August 12, 2015, 04:25:11 PM »
    The amount of time wasted writing comments for everything is massive especially in large projects such as this. Which is why I stated, in my posts, that its slated for AFTER when I finish the core features.

    Missed that, my apologizes.

    Offlinesini

    • Member
    • ****
    • *
    • *
    • Posts: 5,785
    • Thanks: +0/-0
      • View Profile
    Re: API Reference Guide
    « Reply #9 on: August 12, 2015, 04:41:48 PM »
    nw. :)

     

    Copyright © 2017 MoparScape. All rights reserved.
    Powered by SMFPacks SEO Pro Mod |
    SimplePortal 2.3.5 © 2008-2012, SimplePortal