- Joined
- Jul 1, 2009
- Messages
- 1,147
I have an idea in my head for a difficulty set system and half way through it I realized the game may not accept decimal in Integers.
I do know you can't change an integer to a decimal in the editor, but can it be a decimal in the actual game?
My difficult system essentially works like this:
Player chooses difficulty:
---------------------------------
Difficulty: Integer = #
---------------------------------
Easy: Difficulty - Pick P# = 1
Medium: Difficulty - Pick P# = 2
Hard: Difficulty - Pick # = 3
Difficulty - Pick P1 Initial Value = 0
Difficulty - Pick P2 Initial Value = 0
Difficulty - Pick P3 Initial Value = 0
Difficulty - Pick P4 Initial Value = 0
---------------------------------
After 30 seconds, to set difficulty:
---------------------------------
Set (Difficulty - Set) = ((Difficulty - Pick P1 + (Difficulty - Pick P2 + (Difficulty - Pick P3 + Difficulty - Pick P4))) / Active Players)
Active players is an integer variable I have set to the number of active players currently in the game.
However if, for example, there are 2 players in the game, one chooses hard (3) and one chooses medium (2) that would mean Set (Difficulty - Set) would be 5 / 2 = 2.5.
If the game registers 2.5 as an integer variable, what is going to happen? Will it round up or down?
I can't make a trigger that registers 2.5 as an answer because I literally can't type in 2.5.
If I use "<=" or ">=" then, for example, (>= 1) could mean 2 or 3.
I don't want to finish the code and test it because I fear that all the time coding it will be of waste.
Any help?
I do know you can't change an integer to a decimal in the editor, but can it be a decimal in the actual game?
My difficult system essentially works like this:
Player chooses difficulty:
---------------------------------
Difficulty: Integer = #
---------------------------------
Easy: Difficulty - Pick P# = 1
Medium: Difficulty - Pick P# = 2
Hard: Difficulty - Pick # = 3
Difficulty - Pick P1 Initial Value = 0
Difficulty - Pick P2 Initial Value = 0
Difficulty - Pick P3 Initial Value = 0
Difficulty - Pick P4 Initial Value = 0
---------------------------------
After 30 seconds, to set difficulty:
---------------------------------
Set (Difficulty - Set) = ((Difficulty - Pick P1 + (Difficulty - Pick P2 + (Difficulty - Pick P3 + Difficulty - Pick P4))) / Active Players)
Active players is an integer variable I have set to the number of active players currently in the game.
However if, for example, there are 2 players in the game, one chooses hard (3) and one chooses medium (2) that would mean Set (Difficulty - Set) would be 5 / 2 = 2.5.
If the game registers 2.5 as an integer variable, what is going to happen? Will it round up or down?
I can't make a trigger that registers 2.5 as an answer because I literally can't type in 2.5.
If I use "<=" or ">=" then, for example, (>= 1) could mean 2 or 3.
I don't want to finish the code and test it because I fear that all the time coding it will be of waste.
Any help?