Drop Behavior question-solved
MrsM
16 Jan 2013, 20:52I feel certain that I am just missing something due to lack of coffee.
I cannot work out how to make this drop behaviors work.
The player must choose one of 3 items and may only carry one at a time. If the player puts the held item down, then he can pick up a different item. i actually accomplished making it so that they can only pick up one, if the player is holding one i set a flag so if player has flag the other items cannot be picked up.
where i am running into trouble is, how do i create script or whatnot where when the player drops the item, the item is back in the room the player is currently in, and the flag is unset. when i chose run script on the drop behavior as opposed to default behavior, i could choose to unset the flag but then the options are remove object (where does it go? it just goes to parent.null, right?) move object, etc. is it possible to script moving the object with an expression for it to go in the current room? what expression would that be?
i feel silly, this seems like it should be so simple, but havent quite sorted it out.
I cannot work out how to make this drop behaviors work.
The player must choose one of 3 items and may only carry one at a time. If the player puts the held item down, then he can pick up a different item. i actually accomplished making it so that they can only pick up one, if the player is holding one i set a flag so if player has flag the other items cannot be picked up.
where i am running into trouble is, how do i create script or whatnot where when the player drops the item, the item is back in the room the player is currently in, and the flag is unset. when i chose run script on the drop behavior as opposed to default behavior, i could choose to unset the flag but then the options are remove object (where does it go? it just goes to parent.null, right?) move object, etc. is it possible to script moving the object with an expression for it to go in the current room? what expression would that be?
i feel silly, this seems like it should be so simple, but havent quite sorted it out.

guzmere
16 Jan 2013, 21:08Well MrsM if I've got this right is this for the whole game if so you could set the player maximum objects to 1 that would save a lot of hassle. It's in the player object under inventory. Welcome to the forums, have a good day. Terry

Otherwise you could use the expression of [player.parent], that would drop it in the player's location.




Otherwise you could use the expression of [player.parent], that would drop it in the player's location.
MrsM
16 Jan 2013, 22:39unfortunatly, there will be other inventory items, too. the idea is, the player chooses one item and the npc's will react differently to player depending on which one player has chosen. if player discovers they can't get anywhere with a certain npcs, they can return to the closet where the items are located and choose a different one. It's part of the puzzle/stratedgy of the game.
one thought I had was since you can only choose one at a a time, when you drop an item, it returns to the location of hte 3 objects. i can write that to make some sense, with only a slight bit of inconveinance for the player, although if i make it funny, maybe they won't care.
one thought I had was since you can only choose one at a a time, when you drop an item, it returns to the location of hte 3 objects. i can write that to make some sense, with only a slight bit of inconveinance for the player, although if i make it funny, maybe they won't care.

Pertex
17 Jan 2013, 07:36Do you mean something like this:


MrsM
17 Jan 2013, 14:09Pertex- When the object is dropped using that script, where will it go? I apologize, I am still a little new...I can understand a lot of the stuff, but some is just a little beyond me still.

Pertex
17 Jan 2013, 15:52"MoveObject this to game.pov.parent" moves the object into the room where the player is in at this moment. The parent of the player (game.pov is the actual player object) is (mostly) a room.
You can move the object to every other room you want with "MoveObject this to roomname" or you could set the object parent directly with "this.parent=roomname"
You can move the object to every other room you want with "MoveObject this to roomname" or you could set the object parent directly with "this.parent=roomname"
MrsM
18 Jan 2013, 05:01Pertex- Thankyou. The move object/this/game.pov.parent was exactly what i needed and worked for another issue also. ty.

guzmere
21 Jan 2013, 20:26Pertex wrote:"MoveObject this to game.pov.parent" moves the object into the room where the player is in at this moment. The parent of the player (game.pov is the actual player object) is (mostly) a room.
You can move the object to every other room you want with "MoveObject this to roomname" or you could set the object parent directly with "this.parent=roomname"
Hi Pertex I'm confused does not the player.parent work for moving objects to the location where the player is. Could you explain (this) to me please. Terry





Pertex
21 Jan 2013, 21:01Did you read this? http://quest5.net/wiki/Changing_the_player_object

guzmere
21 Jan 2013, 21:19No I kinda missed it as usual at the moment I'm staying on 5.2 for now. Chickening out of learning new stuff for the time being while I finish off my second game. I must admit that I kind of like the old style face where I can dump the header and the input line is more discreet. But like the dinosaurs I'll adapt sooner or later, or just die out. Thanks for that. Terry




