|
|
|
|
Was C-Script honestly this.. strict?
#171302
12/05/07 18:56
12/05/07 18:56
|
Joined: Apr 2005
Posts: 3,815 Finland
Inestical
OP
Rabbit Developer
|
OP
Rabbit Developer
Joined: Apr 2005
Posts: 3,815
Finland
|
Am I not able to give in two arrays of four values to an C-Script function?
on_l addExp(enemyArray, playerArray); //Phails, whines about too many values
"Yesterday was once today's tomorrow."
|
|
|
Re: Was C-Script honestly this.. strict?
[Re: FBL]
#171305
12/05/07 22:29
12/05/07 22:29
|
Joined: Apr 2005
Posts: 3,815 Finland
Inestical
OP
Rabbit Developer
|
OP
Rabbit Developer
Joined: Apr 2005
Posts: 3,815
Finland
|
bah it still whines about too many values:
function addExp(var enemyArray[4], var playerArray[3]) -> Syntax Error: addExp - Too many parameters
"Yesterday was once today's tomorrow."
|
|
|
Re: Was C-Script honestly this.. strict?
[Re: Fenriswolf]
#171307
12/07/07 17:59
12/07/07 17:59
|
Joined: Apr 2005
Posts: 3,815 Finland
Inestical
OP
Rabbit Developer
|
OP
Rabbit Developer
Joined: Apr 2005
Posts: 3,815
Finland
|
Oh yes, I forgot about that.
Now, why is this not working?
function addExp(&enemyArray, &playerArray) { var enemyLvl = enemyArray[0]; var enemyHlth = enemyArray[1]; var enemyStr = enemyArray[2]; var enemyDef = enemyArray[3]; var playerLvl = playerArray[0]; var playerStr = playerArray[1]; var playerDef = playerArray[2];
"Yesterday was once today's tomorrow."
|
|
|
Re: Was C-Script honestly this.. strict?
[Re: Inestical]
#171308
12/07/07 21:16
12/07/07 21:16
|
Joined: Jan 2007
Posts: 221
Fenriswolf
Member
|
Member
Joined: Jan 2007
Posts: 221
|
Probably you'll have to do it the inconvenient way in C-Script:
var enemyLvl; enemyLvl = enemyArray[0]; [...]
Last edited by Fenriswolf; 12/07/07 21:16.
|
|
|
Re: Was C-Script honestly this.. strict?
[Re: Fenriswolf]
#171309
12/08/07 18:47
12/08/07 18:47
|
Joined: Jan 2006
Posts: 968
EpsiloN
User
|
User
Joined: Jan 2006
Posts: 968
|
You can assign numbers to a variable in a function : Code:
var test = 32;
But you cant directly assign other arrays to a definition of a new variable.
|
|
|
|
|
|
|