Gamestudio Links
Zorro Links
Newest Posts
zorro license, IB connection
by miwok. 12/06/23 16:32
Newbie Questions
by fairtrader. 12/06/23 11:29
Zorro Trader GPT
by TipmyPip. 12/04/23 11:34
Square root rule
by Smallz. 12/02/23 09:15
RTest not found error
by TipmyPip. 12/01/23 21:43
neural function for Python to [Train]
by TipmyPip. 12/01/23 14:47
Xor Memory Problem.
by TipmyPip. 11/28/23 14:23
Training with command line parameters
by TipmyPip. 11/26/23 08:42
AUM Magazine
Latest Screens
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Who's Online Now
6 registered members (miwok, AndrewAMD, TipmyPip, 3run, Quad, 1 invisible), 645 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
fairtrader, hus, Vurtis, Harry5, KelvinC
19019 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
better usage of flags or skills??? #246799
01/17/09 10:27
01/17/09 10:27
Joined: Jan 2009
Posts: 8
A
anomily01 Offline OP
Newbie
anomily01  Offline OP
Newbie
A

Joined: Jan 2009
Posts: 8
i remember hearing a tip once about a way in your code to basically get two flags or skills out of each one. i.e. do something to the inputted value to get multiple values out of it. something like dividing by ten or some way of telling the engine to ignore anything after the decimal point etc.???

anyone know or remember this tip?

Re: better usage of flags or skills??? [Re: anomily01] #246819
01/17/09 13:10
01/17/09 13:10
Joined: Jul 2002
Posts: 4,436
Germany, Luebeck
Xarthor Offline
Expert
Xarthor  Offline
Expert

Joined: Jul 2002
Posts: 4,436
Germany, Luebeck
you can ignore anything behind the decimal point by using int()

myVar = int(3.5); // myVar is now 3

Re: better usage of flags or skills??? [Re: Xarthor] #246850
01/17/09 15:53
01/17/09 15:53
Joined: Jul 2008
Posts: 170
Germany, near Mainz
Nicotin Offline
Member
Nicotin  Offline
Member

Joined: Jul 2008
Posts: 170
Germany, near Mainz
Ah, yes I know what you mean.
it would be like this:
Code:
my.skill2 = 30;//
my.skill2 += 0.102//Skill 2 is now 30.102
 


than you can use it with "integer()" and "fraction()"
"fraction(skill2)" would give out "102"
and
"integer(skill2)" would gve out "30"

and if you want to reset the decimal values you just have to do "my.skill2 = integer(my.skill2);"

Last edited by Nicotin; 01/17/09 15:57.


Re: better usage of flags or skills??? [Re: Nicotin] #247110
01/19/09 04:37
01/19/09 04:37
Joined: Jan 2009
Posts: 8
A
anomily01 Offline OP
Newbie
anomily01  Offline OP
Newbie
A

Joined: Jan 2009
Posts: 8
ok thats tite thanks. now i have double the usable skills. 1 skill can do two things

Re: better usage of flags or skills??? [Re: anomily01] #247135
01/19/09 08:15
01/19/09 08:15
Joined: Jan 2009
Posts: 36
Philippines
U
unknown_master Offline
Newbie
unknown_master  Offline
Newbie
U

Joined: Jan 2009
Posts: 36
Philippines
function decimal_increase()
{
var number = 0;
var number1= 0.1;
var result;
result=number * number1 * time_step;
return;
}

i dont think it will works!! ^_^



From: Philippine Game Developers.


Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1