Thread: Just curious

Page 1 of 2 12 LastLast
Results 1 to 10 of 11
  1. #1 Just curious 
    Member of the Imagine Cult

    Join Date
    Feb 2013
    Posts
    519
    Thanks given
    21
    Thanks received
    7
    Rep Power
    59
    Hey guys, I've developed a game where each "item" had its own serial code. Meaning every time I spawned an item, it was its own item.

    So lets say I spawned an item, it would have a serial code: 001. Then I spawned the same item again, and this item would have serial code: 002. Even when I restart server code, the serial code stays.

    I was wondering if this was achievable in RSPS? I tried a couple of times doing it but I could never get my head around it :/

    I know there are several people smarter than me at Java and some just have a mind for thinking outside the box. Maybe one of you can suggest a way this may be possible

    Reason why I would like this: Would make "Draining", "Corrupting", and other sorts of things like this much easier to do.
    Reply With Quote  
     

  2. #2  
    Donator

    Join Date
    Oct 2014
    Posts
    587
    Thanks given
    29
    Thanks received
    76
    Rep Power
    26
    Ofcourse.. you should make a object for every item, thats how you do it.
    Programming service - Fast, Cheap & Quality
    http://www.rune-server.org/black-mar...-services.html

    Project that I am currently working on:
    http://www.rune-server.org/runescape...emon-rsps.html

    Reply With Quote  
     

  3. #3  
    Registered Member
    Join Date
    Dec 2014
    Posts
    8
    Thanks given
    0
    Thanks received
    0
    Rep Power
    0
    Quote Originally Posted by Excision Pk View Post
    Ofcourse.. you should make a object for every item, thats how you do it.
    Creating an object wouldnt wok as it would just be destroyed when the server restarted.

    You will need to have a data file that when the server is restarted it will populate the file with the necessary information for when the server is back online you read the file and build the objects from the given information, then spawn them.
    Reply With Quote  
     

  4. #4  
    Member of the Imagine Cult

    Join Date
    Feb 2013
    Posts
    519
    Thanks given
    21
    Thanks received
    7
    Rep Power
    59
    Quote Originally Posted by Bookie Guy View Post
    Creating an object wouldnt wok as it would just be destroyed when the server restarted.

    You will need to have a data file that when the server is restarted it will populate the file with the necessary information for when the server is back online you read the file and build the objects from the given information, then spawn them.
    Okay I understand what ya mean, but how would the item be linked to the necessary information. Like how would the server know what is connected to what :/
    Reply With Quote  
     

  5. #5  
    Donator

    Join Date
    Oct 2014
    Posts
    587
    Thanks given
    29
    Thanks received
    76
    Rep Power
    26
    Quote Originally Posted by Bookie Guy View Post
    Creating an object wouldnt wok as it would just be destroyed when the server restarted.

    You will need to have a data file that when the server is restarted it will populate the file with the necessary information for when the server is back online you read the file and build the objects from the given information, then spawn them.
    Its pretty obvious that the item should be saved to the character file on logout, just like every rsps released does. Didn't think I had to point that out. Ever heard of Json object serialization?

    Quote Originally Posted by FiveRiverFlo View Post
    Okay I understand what ya mean, but how would the item be linked to the necessary information. Like how would the server know what is connected to what :/
    Create a object of a item, ex:
    Code:
    addItem(new Item(id, amount));
    Now on logout loop trough the container the item is in and save it ex:

    Code:
    for (Item item : inventoryContainer.items) {
    item.getId()
    item.getSize()
    }
    From here its simple to add more things such as 'charge'.

    Or just use the Json libary for object serialization, it saves the state of the object in Json format.
    Programming service - Fast, Cheap & Quality
    http://www.rune-server.org/black-mar...-services.html

    Project that I am currently working on:
    http://www.rune-server.org/runescape...emon-rsps.html

    Reply With Quote  
     

  6. #6  
    Registered Member
    Join Date
    Dec 2014
    Posts
    8
    Thanks given
    0
    Thanks received
    0
    Rep Power
    0
    Quote Originally Posted by Excision Pk View Post
    Its pretty obvious that the item should be saved to the character file on logout, just like every rsps released does. Didn't think I had to point that out. Ever heard of Json object serialization?



    Create a object of a item, ex:
    Code:
    addItem(new Item(id, amount));
    Now on logout loop trough the container the item is in and save it ex:

    Code:
    for (Item item : inventoryContainer.items) {
    item.getId()
    item.getSize()
    }
    From here its simple to add more things such as 'charge'.

    Or just use the Json libary for object serialization, it saves the state of the object in Json format.
    I believe what he wants is an original item for each instance of an item like in borderlands it would be slower to read them off everyones player file rather than read it off of one xml file..
    Reply With Quote  
     

  7. #7  
    Member of the Imagine Cult

    Join Date
    Feb 2013
    Posts
    519
    Thanks given
    21
    Thanks received
    7
    Rep Power
    59
    Okay I understand what you all mean, but this would mean that I would have to tell the server, or save the name of the player along with the item eh to indicate who has what with what charge right?
    Reply With Quote  
     

  8. #8  
    Donator

    Join Date
    Oct 2014
    Posts
    587
    Thanks given
    29
    Thanks received
    76
    Rep Power
    26
    Quote Originally Posted by FiveRiverFlo View Post
    Okay I understand what you all mean, but this would mean that I would have to tell the server, or save the name of the player along with the item eh to indicate who has what with what charge right?
    Please be more clear, your asking for a way to make it so ever item holds its own properties right? If a player logs out the items get saved to his character file and if he logs back in it gets loaded as a item object again.

    Its a pretty simple concept.
    Programming service - Fast, Cheap & Quality
    http://www.rune-server.org/black-mar...-services.html

    Project that I am currently working on:
    http://www.rune-server.org/runescape...emon-rsps.html

    Reply With Quote  
     

  9. #9  
    anInt69

    Max _'s Avatar
    Join Date
    Feb 2012
    Age
    26
    Posts
    1,801
    Thanks given
    426
    Thanks received
    727
    Rep Power
    599
    If this game you've developed was also in Java wouldn't it make sense to use the same concept with the RSPS item container system?
    Reply With Quote  
     

  10. #10  
    Banned Just curious Market Banned


    Join Date
    Jan 2011
    Age
    26
    Posts
    3,112
    Thanks given
    1,198
    Thanks received
    1,479
    Rep Power
    0
    don't bother putting all that effort into something like this. it'd be extremely difficult to maintain, and you'd just end up wasting memory and resources for something that isn't even needed
    Reply With Quote  
     

Page 1 of 2 12 LastLast

Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Similar Threads

  1. Just curious
    By Aymen in forum Chat
    Replies: 9
    Last Post: 02-14-2013, 07:02 PM
  2. Just curious.
    By Sieu in forum Help
    Replies: 3
    Last Post: 07-21-2012, 08:42 AM
  3. I'm just curious about something...
    By Hidden Gamer in forum Help
    Replies: 6
    Last Post: 11-01-2011, 10:17 AM
  4. Just curious
    By Mental Piracy in forum Configuration
    Replies: 7
    Last Post: 01-02-2010, 08:56 PM
  5. Just curious
    By tucybro in forum Help
    Replies: 0
    Last Post: 12-24-2009, 02:27 AM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •