User Tag List

Page 1 of 2 1 2 LastLast
Results 1 to 10 of 17

Thread: Inventory item dropping + lacewing

  1. #1
    Clicker Fusion 2.5 DeveloperiOS Export ModuleSWF Export ModuleMac Export Module
    Hydra's Avatar
    Join Date
    May 2012
    Posts
    141
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Inventory item dropping + lacewing

    Hey guys! I appreciate all of the help I am getting with lacewing! I'm learning so much.
    I've created an inventory system in which users can drop money+items so other players can pick them up.
    Here are my events:

    +user clicks button
    -create "coin" next to "self"
    -set alterable value A of "coin" to amount in edit box
    -create "coin detector"
    -send string to channel with "value" "X position of coin" and "Y position" delimited by "#" subchannel 1

    +always
    -set "coin detector" on top of "coin"

    +on subchannel 1 text message
    -create "coin"
    -create "coin detector"
    -set coin value and position to received string

    +when click on coin detector
    +coin detector is overlapping coin
    -set value of coin to "money"
    -destroy coin and coin detector
    -send text to channel "value" "X position of coin" and "Y position" delimited by "#" subchannel 2

    This part works fine but i cant figure out how to let other players know that a coin has been picked up. Here's what i tried:
    +on text message subchannel 2
    +"peer" is overlapping coin
    +X position of coin = received element 1
    +Y position of coin = received element 2
    -destroy coin and coin detector

    I think the problem is because the string hasn't been delimited yet. But how else can I fix this system?

    On top of that, how would a player be able to see coins that were dropped before he enters the map?

  2. #2
    Clicker

    Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleSWF Export Module
    Konidias's Avatar
    Join Date
    Aug 2009
    Posts
    1,546
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    You should make the coins serverside items. By that I mean the server is what is keeping track of where the item should be positioned, and what the item is, etc... then the server just sends that info to all players.

    So when a player enters a map, it should check with the server to see what items are there, and then create those items for the player's screen.

    Definitely do not let the players be in control of money or items on the client.

    So basically to drop coins, the player would send a command to the server "drop x amount of coins" and the server would then check the player's account for the coins, make sure they have enough, then it would subtract from the player, and then "place" the coins down on the ground. Then it would send a message to all players to display the coins at that location.

    If a player picks up the coins, the server checks this and then removes the coins and gives them to the player.

  3. #3
    Clickteam Clickteam
    LB's Avatar
    Join Date
    Jun 2007
    Location
    Richardson, Texas, North America
    Posts
    8,937
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    Konidias is right - if something should not be controlled by the player, it should be controlled by the server. However it should be that the server automatically sends all information to connecting clients rather than the clients having to ask the server first.
    Working as fast as I can on Fusion 3

  4. #4
    Clicker

    Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleSWF Export Module
    Konidias's Avatar
    Join Date
    Aug 2009
    Posts
    1,546
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    I never said the client had to ask the server first. :p

  5. #5
    Clickteam Clickteam
    LB's Avatar
    Join Date
    Jun 2007
    Location
    Richardson, Texas, North America
    Posts
    8,937
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Konidias View Post
    So when a player enters a map, it should check with the server to see what items are there, and then create those items for the player's screen.
    I guess I misinterpreted this as meaning that the player asks the server rather than the server telling the player, sorry.

  6. #6
    Clicker

    Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleSWF Export Module
    Konidias's Avatar
    Join Date
    Aug 2009
    Posts
    1,546
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    Ah, yeah. I definitely meant the server tells the player what is there.

  7. #7
    Clicker Fusion 2.5 DeveloperiOS Export ModuleSWF Export ModuleMac Export Module
    Hydra's Avatar
    Join Date
    May 2012
    Posts
    141
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    How would i save the information for the position of the item? for example if a sword is item ID #1 then how would i save it in an INI?
    [Map ID]
    Item ID = X#Y

    The the clients would delimit the string and set the item to that position? correct?

  8. #8
    Clickteam Clickteam
    LB's Avatar
    Join Date
    Jun 2007
    Location
    Richardson, Texas, North America
    Posts
    8,937
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    Noo, you will not be sending the INI, or any strings for that matter. Read James' Binary message tutorial:
    http://community.clickteam.com/showthread.php?t=58123
    Working as fast as I can on Fusion 3

  9. #9
    Clicker Fusion 2.5 DeveloperiOS Export ModuleSWF Export ModuleMac Export Module
    Hydra's Avatar
    Join Date
    May 2012
    Posts
    141
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ok. I'm wondering how the server will remember where specific items are so in case a player enters a map they will be able to see all items already there.

  10. #10
    Clickteam Clickteam
    LB's Avatar
    Join Date
    Jun 2007
    Location
    Richardson, Texas, North America
    Posts
    8,937
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    Oh, I see. The server would simulate the games on its end to prevent cheating. In your case you don't need an INI, you just need to create the items where they are and give them a Channel alterable string so you know which game they are associated with.
    Working as fast as I can on Fusion 3

Page 1 of 2 1 2 LastLast

Similar Threads

  1. Dragging and dropping objects from a group
    By Morthian in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 27th March 2013, 10:40 PM
  2. Hi-Score object (scores dropping by 1?)
    By JohnC in forum Multimedia Fusion 2 - Technical Support
    Replies: 12
    Last Post: 8th November 2010, 01:52 PM
  3. Dropping a bouncing object
    By Digitalic in forum Multimedia Fusion 2 - Technical Support
    Replies: 19
    Last Post: 25th May 2010, 02:11 PM
  4. FPS keeps dropping when I replace colors?
    By N64Mario in forum Multimedia Fusion 2 - Technical Support
    Replies: 5
    Last Post: 8th December 2008, 12:46 AM
  5. Dropping blocks
    By RobTheBuilder in forum Multimedia Fusion 2 - Technical Support
    Replies: 1
    Last Post: 24th November 2007, 11:50 PM

Posting Permissions

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