• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

SKULL RANDOM TFS 1.3

jel

Member
Joined
Mar 22, 2014
Messages
302
Reaction score
12
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);
 
Solution
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)];
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:
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 ==========
 
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)];
 
Solution
Back
Top