Welcome, guest! Please login or register.

    * Shoutbox

    RefreshHistory
    • ragnoroker: Brand new unique server just released! - Awesome Community - [link]
      October 14, 2019, 11:11:32 AM
    • ragnoroker: Brand new unique server just released! - Awesome Community - [link]
      October 14, 2019, 11:11:28 AM
    • ragnoroker: Brand new unique server just released! - Awesome Community - [link]
      October 14, 2019, 11:11:23 AM
    • marquise:[link]
      October 11, 2019, 12:24:21 PM
    • marquise: hey guys try autoscape.org [link]
      October 11, 2019, 12:19:08 PM
    • Rash: is this site still ded
      October 08, 2019, 07:54:22 PM
    • The Meek: Just Uploaded New Server ~Phusion~
      October 01, 2019, 03:30:31 AM
    • ragnoroker: Pre-EOC New server just dropped today! Come check it out :) - [link]
      September 27, 2019, 08:43:43 PM
    • ragnoroker: Pre-EOC New server just dropped today! Come check it out :) - [link]
      September 27, 2019, 08:43:40 PM
    • ragnoroker: Pre-EOC New server just dropped today! Come check it out :) - [link]
      September 27, 2019, 08:43:33 PM
    • PavSwag: try autoscape,0rg today i will personally help you get RICH and well KNOWN - pav
      September 26, 2019, 09:02:13 AM
    • PavSwag: try autoscape,0rg today i will personally help you get RICH and well KNOWN - pav
      September 26, 2019, 08:52:25 AM
    • ragnoroker: Brand new server! Join today - Good Eco/Nice Players - [link]
      September 25, 2019, 08:59:33 AM
    • ragnoroker: Brand new server! Join today - Good Eco/Nice Players - [link]
      September 25, 2019, 08:59:24 AM
    • ragnoroker: Brand new server! Join today - Good Eco/Nice Players - [link]
      September 25, 2019, 08:59:15 AM
    • PavSwag: bopalini
      September 23, 2019, 10:08:02 PM
    • PavSwag: Join autoscape,0rg fun events daily for infernal mystery boxes only server with Infernal Twisted Bow
      September 23, 2019, 03:05:33 PM
    • Frostydapure: Upcoming dmm/open pvp world server, 2006 style (different and fun trus me) [link] join join!
      September 23, 2019, 08:05:52 AM
    • Frostydapure: Upcoming dmm/open pvp world server, 2006 style (different and fun trus me) [link] join join!
      September 23, 2019, 08:05:45 AM
    • PavSwag: try autoscape,0rg today i will personally help you get RICH and well KNOWN - pav
      September 22, 2019, 02:55:32 PM

    Author Topic: API Reference Guide  (Read 2282 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