SKULL RANDOM TFS 1.3

jel

Well-Known Member
Joined
Mar 22, 2014
Messages
36
Reaction score
2
help this erro.

1> monster.cpp
1>..\src\monster.cpp(52): error C2660: 'uniform_random': function does not take 4 arguments
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========


line monster.cpp
skull = uniform_random(SKULL_YELLOW, SKULL_WHITE, SKULL_RED, SKULL_BLACK);
 

Frija

Active Member
Joined
Jul 2, 2014
Messages
109
Reaction score
50
C++:
skull = uniform_random(SKULL_YELLOW, SKULL_BLACK);
But it will also include the green skull.

or:
C++:
Skulls_t skulls[] = {SKULL_YELLOW, SKULL_WHITE, SKULL_RED, SKULL_BLACK};
skull = skulls[normal_random(0, 3)];
 
Last edited:
OP
J

jel

Well-Known Member
Joined
Mar 22, 2014
Messages
36
Reaction score
2
C++:
skull = uniform_random(SKULL_YELLOW, SKULL_BLACK);
But it will also include the green skull.

or:
C++:
int skulls[] = {SKULL_YELLOW, SKULL_WHITE, SKULL_RED, SKULL_BLACK};
skull = skulls[normal_random(0, 3)];
now
1> monster.cpp
1>..\src\monster.cpp(53): error C2440: '=': cannot convert from 'int' to 'Skulls_t'
1> ..\src\monster.cpp(53): note: Conversion to enumeration type requires an explicit cast (static_cast, C-style cast or function-style cast)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
 

Frija

Active Member
Joined
Jul 2, 2014
Messages
109
Reaction score
50
Edited the original post. You haven't included the "skull" variable type. Try:
C++:
Skulls_t skulls[] = {SKULL_YELLOW, SKULL_WHITE, SKULL_RED, SKULL_BLACK};
skull = skulls[normal_random(0, 3)];
 
  • Like
Reactions: jel
Top