I didn't even request this, and this will save me lots of trouble!
Thanks a bunch!
<TheGiz> oh hai doggy, oh no that's the straw that broke tjhe came baclsb
Hey James, sorry it took me so long to get to this, but I've been testing and so far everything works awesome! You rock!
My website, the home of Motrya:
http://www.jshgaming.com
My website, the home of Motrya:
http://www.jshgaming.com
Well then, new problem. I have no explanation for this; let's see if anyone else can guess.
Here's a video I made that shows it in action with commentary:
PSYCHE
tl;dw version: Extra data bit 0 seems to always come out as 12 higher than it should for me when passed as an argument. Extra data 1 and 2 also always seem to be 0, but I could just not be testing them extensively enough.
EDIT: I tested changing the + 400 to + 388. This fixed the "1" value card, but the "2" value card became "3", "3" became "5" and so on. + 2 at each iteration. This is... BIZARRE. So it isn't just adding 12 to the value. It's adding 12 + 2n or something.
My website, the home of Motrya:
http://www.jshgaming.com
Here's a video I made that shows it in action with commentary:
PSYCHE
tl;dw version: Extra data bit 0 seems to always come out as 12 higher than it should for me when passed as an argument. Extra data 1 and 2 also always seem to be 0, but I could just not be testing them extensively enough.
EDIT: I tested changing the + 400 to + 388. This fixed the "1" value card, but the "2" value card became "3", "3" became "5" and so on. + 2 at each iteration. This is... BIZARRE. So it isn't just adding 12 to the value. It's adding 12 + 2n or something.
My website, the home of Motrya:
http://www.jshgaming.com
Do you have the "suspend gameplay" bit turned off or on for this menu?
If "suspend gameplay" is turned ON, then the script will not be run until the menu is gone, and the first three script arguments will be filled with the menu extra data.
If "suspend gameplay" is turned OFF, then the script will be run while the menu is still open, and the first argument will be the menu item handle. the menu extra data will NOT be passed directly to the script. You have to retrieve it yourself using the get menu item extra command. I think this is probably the situation you are seeing.
That would explain the strange values for the first argument, because it is actually a menu item handle, and it would explain why the second and third argument are always 0
If "suspend gameplay" is turned ON, then the script will not be run until the menu is gone, and the first three script arguments will be filled with the menu extra data.
If "suspend gameplay" is turned OFF, then the script will be run while the menu is still open, and the first argument will be the menu item handle. the menu extra data will NOT be passed directly to the script. You have to retrieve it yourself using the get menu item extra command. I think this is probably the situation you are seeing.
That would explain the strange values for the first argument, because it is actually a menu item handle, and it would explain why the second and third argument are always 0
James Paige wrote:
Do you have the "suspend gameplay" bit turned off or on for this menu?
If "suspend gameplay" is turned ON, then the script will not be run until the menu is gone, and the first three script arguments will be filled with the menu extra data.
If "suspend gameplay" is turned OFF, then the script will be run while the menu is still open, and the first argument will be the menu item handle. the menu extra data will NOT be passed directly to the script. You have to retrieve it yourself using the get menu item extra command. I think this is probably the situation you are seeing.
That would explain the strange values for the first argument, because it is actually a menu item handle, and it would explain why the second and third argument are always 0
If "suspend gameplay" is turned ON, then the script will not be run until the menu is gone, and the first three script arguments will be filled with the menu extra data.
If "suspend gameplay" is turned OFF, then the script will be run while the menu is still open, and the first argument will be the menu item handle. the menu extra data will NOT be passed directly to the script. You have to retrieve it yourself using the get menu item extra command. I think this is probably the situation you are seeing.
That would explain the strange values for the first argument, because it is actually a menu item handle, and it would explain why the second and third argument are always 0
AH, yeah that is probably it. I'll test that out. Killing the video btw, Newbie didn't want me showing those graphics just yet. XD
My website, the home of Motrya:
http://www.jshgaming.com
Hmm... so currently, in order to:
1) Have the card appear next to the menu
and
2) Not close the menu every time I want to display a new card
Basically, I have to have each menu item set a different tag ON, then loop through a while to see which of these tags is ON, then run off my switchboard script there. It's either that or make a plotscript for each menu command, which is probably faster in terms of processing but really, really bad if I have to change the system later.
Fun stuff!
EDIT: Tag Method works great so far.
My website, the home of Motrya:
http://www.jshgaming.com
1) Have the card appear next to the menu
and
2) Not close the menu every time I want to display a new card
Basically, I have to have each menu item set a different tag ON, then loop through a while to see which of these tags is ON, then run off my switchboard script there. It's either that or make a plotscript for each menu command, which is probably faster in terms of processing but really, really bad if I have to change the system later.
Fun stuff!
EDIT: Tag Method works great so far.
My website, the home of Motrya:
http://www.jshgaming.com
Full disclosure: I didn't actually watch the video, so i am not sure what the cards are all about, but these goals sound pretty easy:
And I don't understand why tags are needed at all here.
The menu item runs a script, and the script makes the card appear. Why the tags?
JSH357 wrote:
1) Have the card appear next to the menu
2) Not close the menu every time I want to display a new card
2) Not close the menu every time I want to display a new card
And I don't understand why tags are needed at all here.
The menu item runs a script, and the script makes the card appear. Why the tags?
In order to make the card appear, I either have to close the menu so the slices will show up or Allow Gameplay & Scripts so the slices will appear. If I allow gameplay and scripts, Extra Data will not work, so I cannot use my original code. As far as I know there is no convenient method of sending data otherwise besides tags or using different scripts.
The problem with closing the menu is that the cursor always starts at the top of the menu when it reopens. This menu is designed to allow quick viewing down the list, so that's pretty annoying for the player.
My solution was to have each menu item set a tag on. Then I have a script that checks all of the card tags to see if each one was on. It actually runs a lot faster than expected, but I might have to modify it when there are more than 20 cards in the game.
The tag/Extra Data is needed so I can say "pullupcard(x)" instead of having a "database" in my hss file. All of the cards have stats and elements, etc, so I stored that data in Enemy data. It's necessary to know which card was chosen.
The result of my efforts looks like this (The ????s appear if the card isn't owned in the final version, this was a test)
My website, the home of Motrya:
http://www.jshgaming.com
The problem with closing the menu is that the cursor always starts at the top of the menu when it reopens. This menu is designed to allow quick viewing down the list, so that's pretty annoying for the player.
My solution was to have each menu item set a tag on. Then I have a script that checks all of the card tags to see if each one was on. It actually runs a lot faster than expected, but I might have to modify it when there are more than 20 cards in the game.
The tag/Extra Data is needed so I can say "pullupcard(x)" instead of having a "database" in my hss file. All of the cards have stats and elements, etc, so I stored that data in Enemy data. It's necessary to know which card was chosen.
The result of my efforts looks like this (The ????s appear if the card isn't owned in the final version, this was a test)
My website, the home of Motrya:
http://www.jshgaming.com
THIS time I watched the video :)
And it is very nifty.
Okay! I understand the confusion now.
The good news is that yes you can use extra data when "Allow Gameplay & Scripts" is enabled. You just have to do it differently.
Istrongly mildly recommend "Allow Gameplay & Scripts" for all menus. Having it off is really just for backcompat with the old way that the main menu used to work.
Anyway, here is a code example that compares the gameplay-and-scripts OFF method with the gameplay-and-scripts ON method:
And it is very nifty.
Okay! I understand the confusion now.
The good news is that yes you can use extra data when "Allow Gameplay & Scripts" is enabled. You just have to do it differently.
I
Anyway, here is a code example that compares the gameplay-and-scripts OFF method with the gameplay-and-scripts ON method:
Code:
plotscript, react to menu extra data, ex0, ex1, ex2, begin
# this example works for menus with "Allow Gameplay & Scripts" OFF
show value(ex0)
end
plotscript, react to menu extra data, menu item, begin
# this example works for menus with "Allow Gameplay & Scripts" ON
variable(ex0, ex1, ex2)
ex0 := get menu item extra(menu item, 0)
ex1 := get menu item extra(menu item, 1)
ex2 := get menu item extra(menu item, 2)
show value(ex0)
end
plotscript, react to menu extra data, ex0, ex1, ex2, begin
# this example works for menus with "Allow Gameplay & Scripts" OFF
show value(ex0)
end
plotscript, react to menu extra data, menu item, begin
# this example works for menus with "Allow Gameplay & Scripts" ON
variable(ex0, ex1, ex2)
ex0 := get menu item extra(menu item, 0)
ex1 := get menu item extra(menu item, 1)
ex2 := get menu item extra(menu item, 2)
show value(ex0)
end
Oh, cool!
That might help in my submenu in which you actually build the deck, which I'm hoping isn't as big a nightmare as I anticipate. The menu for CARD GAME ABILITIES worked out fine with just standard scripting.
EDIT: I changed my scripts to use the commands you mentioned. Works just as well, guessing more efficiently too. Thanks.
My website, the home of Motrya:
http://www.jshgaming.com
That might help in my submenu in which you actually build the deck, which I'm hoping isn't as big a nightmare as I anticipate. The menu for CARD GAME ABILITIES worked out fine with just standard scripting.
EDIT: I changed my scripts to use the commands you mentioned. Works just as well, guessing more efficiently too. Thanks.
My website, the home of Motrya:
http://www.jshgaming.com
A minor bug that has come up while coding this:
Somethings "set sprite visible" seems to affect completely unrelated sprites (well, they might be siblings, but definitely not parents). I have a script that shows about 100 slices on the screen, 50 on each side. Two independent scripts set up their properties. In one, I wanted to "hide" some of the slices under specific circumstances. Making them invisible hid them, but also made slices on the other side RANDOMLY disappear. Very strange. I need to look at it more before saying it's a bug.
My website, the home of Motrya:
http://www.jshgaming.com
Somethings "set sprite visible" seems to affect completely unrelated sprites (well, they might be siblings, but definitely not parents). I have a script that shows about 100 slices on the screen, 50 on each side. Two independent scripts set up their properties. In one, I wanted to "hide" some of the slices under specific circumstances. Making them invisible hid them, but also made slices on the other side RANDOMLY disappear. Very strange. I need to look at it more before saying it's a bug.
My website, the home of Motrya:
http://www.jshgaming.com
JSH357 wrote:
A minor bug that has come up while coding this:
Somethings "set sprite visible" seems to affect completely unrelated sprites (well, they might be siblings, but definitely not parents).
Somethings "set sprite visible" seems to affect completely unrelated sprites (well, they might be siblings, but definitely not parents).
Children of the slice you hide will be hidden too.
I have been thinking about making the slice tree editor available in game as a slice debugger. It might be helpful in sorting out strange things like this.
Side note: I solved that problem by loading more sprites to 'mask' the ones i want to hide. Easy enough!
My website, the home of Motrya:
http://www.jshgaming.com
My website, the home of Motrya:
http://www.jshgaming.com



