Having a menu display objects only if you have them
Hulkman508
18 Aug 2011, 03:08So I've been working on a combat system for my games and I've kind of run into a problem.
What I'm looking for is a menu that will change its options depending on what kind of weapon you have eg. Selet which weapon want Sword, fists, Bow etc. But if You only have a bow it wont show the sword as an option to click onto.
I thought of giving options such as adding conditonal scripts to a menu option 'sword' so if you dont have one you can use one, but then that may get complicated with all the different types of swords. It seems like a lot just for combat, which is why I'm trying to do the first option.
What I'm looking for is a menu that will change its options depending on what kind of weapon you have eg. Selet which weapon want Sword, fists, Bow etc. But if You only have a bow it wont show the sword as an option to click onto.
I thought of giving options such as adding conditonal scripts to a menu option 'sword' so if you dont have one you can use one, but then that may get complicated with all the different types of swords. It seems like a lot just for combat, which is why I'm trying to do the first option.
RedTulip
18 Aug 2011, 06:28Before showing a menu, you could add a conditional script that checks what the player carries. If the player is carrying a certain weapon or such.... Then, you show only one of those menus, instead of changing the menu options.
Hulkman508
19 Aug 2011, 07:49I did try that, but I'm looking at a game with weapons and different grades of weapons. I had two test objects, sword 1 and sword 2. I had a conditional script that said If the player has sword 1, then show fight menu etc. I had another conditonal if the player has sword 1 and sword 2, then show this fight menu etc. What I found was that the menu's overlapped if I had both of the objects.
Is there a way to show if player has any object of this type, then list all on a menu or something? Or is it possible to have invisible menu options?
If not I'll just go with the 'use sword 1 on enemy' option.
Is there a way to show if player has any object of this type, then list all on a menu or something? Or is it possible to have invisible menu options?
If not I'll just go with the 'use sword 1 on enemy' option.
RedTulip
20 Aug 2011, 22:06I haven't found any way to edit the menu through script or hide and show options, so I wouldn't know...
Hulkman508
22 Aug 2011, 08:34Thanks anyway