Steve Jackson Games - Site Navigation
Home General Info Follow Us Search Illuminator Store Forums What's New Other Games Ogre GURPS Munchkin Our Games: Home

Go Back   Steve Jackson Games Forums > Roleplaying > GURPS

Reply
 
Thread Tools Display Modes
Old 11-05-2011, 04:31 AM   #21
vicky_molokh
GURPS FAQ Keeper
 
vicky_molokh's Avatar
 
Join Date: Mar 2006
Location: Kyïv, Ukraine
Default Re: GURPS RCC (Ranged Combat Calculator)

Quote:
Originally Posted by ssveter View Post
That explains the concept of what I need to do. Which is what I figured. my problem right now is not having the knowledge to put it into code. However I am working on it.

I am having trouble parsing the string into parts to put into formula for calculation.
Could you explain the problem more precisely?
__________________
Vicky 'Molokh', GURPS FAQ and uFAQ Keeper
vicky_molokh is offline   Reply With Quote
Old 11-05-2011, 04:52 AM   #22
ssveter
 
ssveter's Avatar
 
Join Date: Jun 2011
Location: Richmond, VA
Default Re: GURPS RCC (Ranged Combat Calculator)

Here's what I am trying to do.

user inputs 45d+1 into dicebox (a textbox) which is then turned into a string

the input is then plugged into a formula that will simulate rolling dice and returning a result.

here is my code so far.

Public Class DiceRollerApp

Dim die As String = "d"
Dim sdie As String
Dim intlocation As Integer
Dim numdice As String
Dim dieopperand As String
Dim diemod As String



Private Sub Dicebx_TextChanged(sender As System.Object, e As System.EventArgs) Handles Dicebx.TextChanged
sdie = Dicebx.Text


End Sub

Private Sub Rollbttn_Click(sender As System.Object, e As System.EventArgs) Handles Rollbttn.Click
intlocation = InStr(sdie, "d")
numdice = Microsoft.VisualBasic.Left(sdie, intlocation - 1)
diemod = Microsoft.VisualBasic.Right(sdie, intlocation - 2)
MessageBox.Show("this is the number of dice " & numdice)
If sdie.Contains("-") = True Then MessageBox.Show("the opperand is a -") Else If sdie.Contains("+") Then MessageBox.Show("the opperand is a +") Else MessageBox.Show("no opperand")
If diemod <> "d" Then MessageBox.Show("this is the die mod " & diemod) Else MsgBox("no modifier")


End Sub

End Class
ssveter is offline   Reply With Quote
Old 11-05-2011, 07:09 AM   #23
vicky_molokh
GURPS FAQ Keeper
 
vicky_molokh's Avatar
 
Join Date: Mar 2006
Location: Kyïv, Ukraine
Default Re: GURPS RCC (Ranged Combat Calculator)

I'm not sure there's a need to bother with operands.
If you can get the string before the d, and the string after the d, then you can convert both into Int32, plug the former into a dieroller RNG, and then print the sum of the result and the second Int32 into the console or whatever.
__________________
Vicky 'Molokh', GURPS FAQ and uFAQ Keeper
vicky_molokh is offline   Reply With Quote
Old 11-07-2011, 04:21 AM   #24
ssveter
 
ssveter's Avatar
 
Join Date: Jun 2011
Location: Richmond, VA
Default Re: GURPS RCC (Ranged Combat Calculator)

Thats what I am trying to do.

Getting stuck on parsing out text from integers
ssveter is offline   Reply With Quote
Old 11-07-2011, 04:24 AM   #25
vicky_molokh
GURPS FAQ Keeper
 
vicky_molokh's Avatar
 
Join Date: Mar 2006
Location: Kyïv, Ukraine
Default Re: GURPS RCC (Ranged Combat Calculator)

Quote:
Originally Posted by ssveter View Post
Thats what I am trying to do.

Getting stuck on parsing out text from integers
Didn't the examples of the three functions in the links help?
__________________
Vicky 'Molokh', GURPS FAQ and uFAQ Keeper
vicky_molokh is offline   Reply With Quote
Old 11-09-2011, 10:05 PM   #26
ssveter
 
ssveter's Avatar
 
Join Date: Jun 2011
Location: Richmond, VA
Default Re: GURPS RCC (Ranged Combat Calculator)

Looks like I have the parsing taken care of. Now the RND is returning results that are out of range for the dice called for. So its something with my for next loop that is screwed....Arrgh
ssveter is offline   Reply With Quote
Reply

Tags
gurps 4e, ranged, ranged combat


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Fnords are Off
[IMG] code is Off
HTML code is Off

Forum Jump


All times are GMT -6. The time now is 02:07 PM.


Powered by vBulletin® Version 3.8.9
Copyright ©2000 - 2024, vBulletin Solutions, Inc.