| View previous topic :: View next topic |
| Author |
Message |
92Garfield I'm a spammer
Reputation: 57
Joined: 20 Dec 2007 Posts: 5871 Location: Banana Republic Germany
|
Posted: Thu Apr 03, 2008 1:39 pm Post subject: VB6 other way of changing variable |
|
|
if i just use setvariable() there always is an error
it should ampliefy like for example the value is 12 you deal 7 dmg = 19 dmg dealt
but when i use setvariable and set it 12 and then deal 7 dmg
the dmg dealt is 7120 -.- _________________
|
|
| Back to top |
|
 |
jason744 Grandmaster Cheater
Reputation: 0
Joined: 25 Nov 2007 Posts: 638
|
Posted: Thu Apr 03, 2008 2:05 pm Post subject: |
|
|
Then that's probably just how the game is coded. _________________
| haxory' wrote: | can't VB do anything??
windows is programmed using VB right? correct me if im wrong.
so all things in windows you have like the start menu is a windows form too. |
|
|
| Back to top |
|
 |
NothingToShow Grandmaster Cheater Supreme
Reputation: 0
Joined: 11 Jul 2007 Posts: 1579
|
Posted: Thu Apr 03, 2008 2:09 pm Post subject: |
|
|
SetVariable() makes the variable to string, so when it* adds to health, or DMG, it's like adding text to the current variable.
*The flash game. |
|
| Back to top |
|
 |
92Garfield I'm a spammer
Reputation: 57
Joined: 20 Dec 2007 Posts: 5871 Location: Banana Republic Germany
|
Posted: Fri Apr 04, 2008 6:25 am Post subject: |
|
|
| Moller wrote: | SetVariable() makes the variable to string, so when it* adds to health, or DMG, it's like adding text to the current variable.
*The flash game. |
i understand
and so the calculation isnt 7 + 12 (without changes by VB) = 19
its then: 7 + [TEXT] = 7[TEXT]0 (cause value still is 0)
but how can i make the flash game and VB knows its a number (and no text) ? _________________
|
|
| Back to top |
|
 |
NothingToShow Grandmaster Cheater Supreme
Reputation: 0
Joined: 11 Jul 2007 Posts: 1579
|
Posted: Fri Apr 04, 2008 6:34 am Post subject: |
|
|
| 92Garfield wrote: | | Moller wrote: | SetVariable() makes the variable to string, so when it* adds to health, or DMG, it's like adding text to the current variable.
*The flash game. |
i understand
and so the calculation isnt 7 + 12 (without changes by VB) = 19
its then: 7 + [TEXT] = 7[TEXT]0 (cause value still is 0)
but how can i make the flash game and VB knows its a number (and no text) ? |
I don't think there's any way. |
|
| Back to top |
|
 |
atom0s Moderator
Reputation: 205
Joined: 25 Jan 2006 Posts: 8587 Location: 127.0.0.1
|
Posted: Fri Apr 04, 2008 6:36 am Post subject: |
|
|
Use a conversion method for the string. Something like:
| Code: | Dim strStringNumber As String
strStringNumber = "7" & Text1.Text & "0"
Dim dwNumber As Long
dwNumber = CLng(strStringNumber) |
Which will convert the string to a long. But if you are passing it to SetVariable, it will have to be a string. Seems to me like you are either not correctly combining the number like you want or something. _________________
- Retired. |
|
| Back to top |
|
 |
92Garfield I'm a spammer
Reputation: 57
Joined: 20 Dec 2007 Posts: 5871 Location: Banana Republic Germany
|
Posted: Fri Apr 04, 2008 7:14 am Post subject: |
|
|
..shit^^
i see you dont understood me the numbers where just examples..
so i can only set variables to strings?
anyone knows a possiblity to avoid that .. bug? _________________
|
|
| Back to top |
|
 |
atom0s Moderator
Reputation: 205
Joined: 25 Jan 2006 Posts: 8587 Location: 127.0.0.1
|
Posted: Fri Apr 04, 2008 1:20 pm Post subject: |
|
|
It's not a bug, it's how Flash handles the values. Everything is a string but will still be interpreted as a number if you use a number as the string.
So if your string is 123, it will be handled as if it was a number. If you use a123, it will attempted to use it as a number, (Possibly use it as a the hex value, not 100% sure on that since I don't touch Flash much.) _________________
- Retired. |
|
| Back to top |
|
 |
92Garfield I'm a spammer
Reputation: 57
Joined: 20 Dec 2007 Posts: 5871 Location: Banana Republic Germany
|
Posted: Fri Apr 04, 2008 1:37 pm Post subject: |
|
|
| Wiccaan wrote: | It's not a bug, it's how Flash handles the values. Everything is a string but will still be interpreted as a number if you use a number as the string.
So if your string is 123, it will be handled as if it was a number. If you use a123, it will attempted to use it as a number, (Possibly use it as a the hex value, not 100% sure on that since I don't touch Flash much.) |
no thats my problem
on this variable it always handles what i type in as text (i think thats why that happens!)
and i need to find a different way  _________________
|
|
| Back to top |
|
 |
|