 |
 |

03-05-2004, 11:11 AM
|
|
Newcomer
|
|
Join Date: Mar 2004
Posts: 16
|
|
Final Fantasy Battle System Help
|
I'm currently designing my own battle system through VB. Everything is going well except for one thing. I have the main form which has all the command buttons like "attack", "defend", magic, and items. when you click on items a new form is loaded off to the side. I have it set to where when you click on one of the items in the listbox, a brief description is desplayed in a label directly above it.
Can someone please help me out with this...HOW DO I SET IT TO WHERE WHENEVER ONE OF THE ITEMS IN THE LIST BOX IS DOUBLE-CLICKED, IT WILL CAUSE AN ACTION IN THE MAIN FORM?
|
|

03-05-2004, 11:44 AM
|
 |
MetaCenturion
Retired Moderator * Guru *
|
|
Join Date: Aug 2001
Location: California, USA
Posts: 16,583
|
|
As long as you know how to do the action, you can just make a public subroutine on your main form.
Code:
Public Sub ItemClickBack()
...
End Sub
When you double-click an item in the listbox, the name of the item will be in the .Text property, and the index of the item in the .ListIndex property.
So, you can do this in the DblClick event of the listbox.
You may also want to make the public subroutine take a parameter for the item that was clicked in the listbox.
P.S. Typing in capital letters is scientifically proven to be harder to read. 
|
|

03-07-2004, 11:14 PM
|
|
Newcomer
|
|
Join Date: Mar 2004
Posts: 16
|
|
String and other variables
|
OK, I do understand what Iceplug is saying. How would I identify strings that are located in the main form from the item form.
EX: strtstrength - randomly generated number located in main form
If you could show me an example of how I would use the double-click button on the item form (frmtitem) to add 10 to strtstrength.
Thanks a lot, any help will be appreciated greatly, and recognition will be given in final update of game.
|
__________________
If there were no Final Fantasy, there would be no point in life...agree?
|

03-08-2004, 02:15 AM
|
 |
Senior Contributor
|
|
Join Date: Aug 2003
Location: Dordrecht,Holland
Posts: 858
|
|
I don't really understand whatyou want, but is it this?
main form (e.g. frmMain)
Code:
'there is text box 'text1.text"
sub form (frmAction)
Code:
'action to set text1.text to a certain value, say command1, a command button
Your vb code in the sub form (frmAction) would be:
Code:
private sub command1_click()'action to set text1.text to a certain value, say command1,
a command button
frmMain.text1.text = "new value"
end sub
QC
|
__________________
Your theory is crazy, but it's not crazy enough to be true.
|

03-08-2004, 07:21 AM
|
 |
MetaCenturion
Retired Moderator * Guru *
|
|
Join Date: Aug 2001
Location: California, USA
Posts: 16,583
|
|
If you have declare StrtStrength as Public in your main form, then you can access the variable by including the name of the form and then a period.
Let's say that you named the form to be Form1 and you want to access StrtStrength.
Form1.StrtStrength = Form1.StrtStrength + 10
will increment StrtStrength on Form1 by 10. 
|
|
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
|
|
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|
|
|
|
 |
|