playMaker

Author Topic: Playmaker and Inventory  (Read 9486 times)

kraeved

  • Playmaker Newbie
  • *
  • Posts: 5
    • View Profile
Playmaker and Inventory
« on: September 09, 2012, 09:20:59 AM »
Good day.

Please provide main ideas - how to create Inventory thigh Playmaker.
What is the best design?

Thanks

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 14684
  • Official Playmaker Support
    • View Profile
Re: Playmaker and Inventory
« Reply #1 on: September 10, 2012, 12:35:35 AM »
Hi,

 Right now, there isn't a real definite strategy to create an inventory in playmaker, simply because inventories can really scale from a simple list to a full blown system...

 so could you define what you are after quite precisly, then it will give a better idea of what we can propose.

bye,

 Jean

kraeved

  • Playmaker Newbie
  • *
  • Posts: 5
    • View Profile
Re: Playmaker and Inventory (updated)
« Reply #2 on: September 11, 2012, 08:32:28 AM »
That i want to do:
1. First Player Controller walk on terrain and Loot some item ( Cube for example)
2. After FPS Loot Cube - Cube disappears from terrain and appear in Inventory
3. Inventory - this is a bag (as wow for example) and have 10 slots (for example)
4. I can move Item from one slot to another in bag, also can equip item to player or destroy item.

This is all that i want

I know how to do stem 1. I make some inventory/bag thigh NGUI - but i can not understand how to create step 2-4.

Thanks

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2488
  • Yup.
    • View Profile
    • Cleverous
Re: Playmaker and Inventory
« Reply #3 on: September 11, 2012, 02:26:19 PM »
There are many many ways to approach inventory, the simplest way is to have when the box is clicked it throws a series of actions, first it destroys the box you clicked and then spawns a placeholder object in your inventory (or sends a message through ngui to create the proper GUI box). That placeholder will have to contain information on what it is so when you throw it back into the world or try to equip it as armor it knows what to do and what object to spawn.

You'll have to read the NGUI / PlayMaker doc's to see how to move your placeholder items around in that view.

Working with inventory you don't really move owned objects into your 'inventory', you just find different ways to represent that you have picked them up and can use/move/drop/consume them. The placeholders are what the player 'owns', and they simply have information along with them.

For instance if you equip the item it just spawns the armor model that the placeholder represents, if you throw it on the ground it just spawns that armor in the world and destroys the placeholder item. So you could click the armor again and it would destroy itself and spawn the placeholder.

Hopefully that helps. This is a basic way to do it, you can go crazy and get into databases and arrays but that is likely too big of a step at this point.

kraeved

  • Playmaker Newbie
  • *
  • Posts: 5
    • View Profile
Re: Playmaker and Inventory (updated)
« Reply #4 on: September 12, 2012, 11:13:20 AM »
"There are many many ways to approach inventory, the simplest way is to have when the box is clicked it throws a series of actions, first it destroys the box you clicked and then spawns a placeholder object in your inventory (or sends a message through ngui to create the proper GUI box)"

I have some questions about this.

I create prefab - make playmaker script: create game object, clicked on on it and game object destroys. It work.

That next Playmaker Action i need to use? Create new game object and spawn it in Inventory? Or crate a gui texture spawn it in Inventory? Also in inventory i have 10 slots. Haw i can move thigh mouse items from one slot to other?

I try find information and some examples about inventory on forum - but i can not find it. Also i am beginer in programming - this is why i start use playmaker.

Thanks






 




Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2488
  • Yup.
    • View Profile
    • Cleverous
Re: Playmaker and Inventory (updated)
« Reply #5 on: September 12, 2012, 11:19:59 AM »
That next Playmaker Action i need to use? Create new game object and spawn it in Inventory? Or crate a gui texture spawn it in Inventory? Also in inventory i have 10 slots. Haw i can move thigh mouse items from one slot to other?

I try find information and some examples about inventory on forum - but i can not find it. Also i am beginer in programming - this is why i start use playmaker.

I'm not really familiar with NGUI but it shouldn't matter what kind of object or method you use as long as it can have an FSM to do actions. You might have to look through the PlayMaker/NGUI doc's to find an answer to your moving items around question unless someone may know off-hand here.

kraeved

  • Playmaker Newbie
  • *
  • Posts: 5
    • View Profile
Re: Playmaker and Inventory
« Reply #6 on: September 14, 2012, 10:26:31 AM »
May be somebody can give ideas haw to make simple inventory system without Ngui (only thigh Playmaker?)

Can i make inventory thigh 10 slots for example and that fsm received global event from loot object - item from prefab spawn in one of the inventory slot? That Playmaker Actions i need to use?

Sjones

  • Full Member
  • ***
  • Posts: 201
    • View Profile
Re: Playmaker and Inventory
« Reply #7 on: September 14, 2012, 09:17:46 PM »
I think this should be made into a tutorial or something, from what I understand unity needs more than playmaker to make inventories, a really basic video that covers implementation of a working system, and verbal descriptions on how it may vary and thoughts about how to solve that issue within the video would be fantastic.

i personally dont need an inventory system exactly but I need a similar system for game play and with no activity on mono sqlite I am stuck with this aspect atm

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 14684
  • Official Playmaker Support
    • View Profile
Re: Playmaker and Inventory
« Reply #8 on: September 15, 2012, 01:15:31 AM »
Hi,

 yes, please be patient, playmaker port to monosqlite is coming, I have it almost ready, but waiting for a monosqlite update to release, since some changes in the api is needed for me to provide a useful port.

 Then, It will be easier to provide a inventory sample.

 bye,

 Jean

Sjones

  • Full Member
  • ***
  • Posts: 201
    • View Profile
Re: Playmaker and Inventory
« Reply #9 on: September 15, 2012, 02:04:37 AM »
I dont mind being patient :P im concernd that mono sqlite dev team has stoped working on it and in turn V2 wont be released. they seemed to be very active over there until 2 months ago and then no support at all, 2 months isnt that long I just hope (I think many others too) that there will be some news soon.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 14684
  • Official Playmaker Support
    • View Profile
Re: Playmaker and Inventory
« Reply #10 on: September 15, 2012, 05:40:09 AM »
Hi,

 I had an email earlier last week from Eduardo, and I did not feel like anything was dropped. But you know, sometimes, we get contracted on big projects, and some things get on a side for while, for very understandable reasons.

 AnyHow, there are other solutions out there for sqlite management, so if it indeed turns out that monosqlite would shut down ( which I doubt at the present moment, like I said), you could get on board other frameworks,

 Bye,

 Jean
« Last Edit: September 15, 2012, 05:45:07 AM by jeanfabre »

Sjones

  • Full Member
  • ***
  • Posts: 201
    • View Profile
Re: Playmaker and Inventory
« Reply #11 on: September 15, 2012, 05:43:22 AM »
thats great news! and will wait patiently :)

kraeved

  • Playmaker Newbie
  • *
  • Posts: 5
    • View Profile
[SOLVED] Re: Playmaker and Inventory
« Reply #12 on: September 16, 2012, 10:33:29 AM »
I make simple inventory

Step 1 - create fsm that loot (mouse down) game object (Cube) on terrain - after that game object is destroyed
Step 2- i make simple inventory thigh NGUI - i find some examples find on youtube (http://www.youtube.com/user/DigitalAbuseMusic?feature=CCwQwRs%3D)
Step 3- I make material in prefab for cube, and than i loot Cube on terrain - it change texture in one of the free inventory slot
Step4 - I make FSM that can move texture from one slot to another.
Stem5 - I make FSM that destroy texture on mouse click and also make FSM that Equip item from prefab and put it to Player.




  
« Last Edit: September 16, 2012, 10:38:29 AM by kraeved »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 14684
  • Official Playmaker Support
    • View Profile
Re: Playmaker and Inventory
« Reply #13 on: September 18, 2012, 04:29:20 AM »
Hi,

 Just made a small update on ArrayMaker, and it now features a basic Inventory system ( search for Inventory scene)

 It's very basic, but demonstrate various mechanisms to pick, reference and check out items from an inventory list.

https://hutonggames.fogbugz.com/default.asp?W715

bye,

 Jean