multiplayer objects
omegix
04 Jul 2007, 20:58Hello, I'm exploring QDK and hoping someone can help me.
I would like to create objects in a multiplayer game that once the player picks up the object, the object will still be available for another logged in player.
I was thinking that I could write a script for the object so that when it is picked up it is also cloned back into the room it's in. It looks like if I do this, I'll have to write a script for each object, and most of the objects in the game will be like this.
Does anyone know of other ways to accomplish cloned / re-spawned objects
without having to write a new script for each individual object?
I would like to create objects in a multiplayer game that once the player picks up the object, the object will still be available for another logged in player.
I was thinking that I could write a script for the object so that when it is picked up it is also cloned back into the room it's in. It looks like if I do this, I'll have to write a script for each object, and most of the objects in the game will be like this.
Does anyone know of other ways to accomplish cloned / re-spawned objects
without having to write a new script for each individual object?
Elexxorine
05 Jul 2007, 19:37Hey. Welcome to quest and stuff. Cloning objects can be done in a few ways. One way is to have an tiem storage room, and create a script that grabs the needed one from there and pops it in the playable world when needed. Onre it's dropped or destroyed or whatever it goes back there. You may also what to create another room for storing a back-up copy of the items so if there isn't one in the storage room it clones one and uses that. In my game I went much further and had the object disappear back to the storage after it was picked up and had objects named after the player's username keep a record of your items as a property. Because if you haven't noticed already, if two people log in they're given player id's in the order that they joined the game. Variables and such get indexed with their number. But if player 1 logs out and a new pecrson joins, he's called player one and gets all the variables that the old player one had. I can provide you with some scripts to add to your game for the cloning and storing and such, but it'll be in asl as it's much harder to program in QDK. But it's dead simple to put a chunk of asl into the game.
Also with your original idea of cloning it back when it's picked up, you don't need a script on each item but to create a custom command, which now can be done as a verb. So you create a new verb called 'pick up' or 'take' and put the croning script in there along with some code to give it to the player and it'll be much easier.
Hope this helps, if you have any more questions just ask me.
Also with your original idea of cloning it back when it's picked up, you don't need a script on each item but to create a custom command, which now can be done as a verb. So you create a new verb called 'pick up' or 'take' and put the croning script in there along with some code to give it to the player and it'll be much easier.

Hope this helps, if you have any more questions just ask me.