Broke combat system somehow SOLVED!!!

It used to work and randomly hit the enemy but ever since I made the stone object/weapon wearable I get a weird error when attacking the snake... Error running script: ERror compiling expression 'GetRandomInt (1,player.wepdmg)':FunctionCallElement: could not find function 'GetrandomInt(Int32; String) '

This is after i type attack snake while the stone is wielded in my primary hand/worn I'm so lost!

Wearing the Stone: Set variable player.weapon = expression this set variable player.wepdmg = expression "+object.itemdmg+"


Io

What's happening here is the game looks for the GetRandomInt function. Normally it's described in the code as GetRandomInt(Integer, Integer). The game, however, thinks you entered the 'upper bound' as a String.

What this suggests to me is that you left, or at one point set, player.wepdmg as a string value - that is to say, "5" instead of just plain 5, which code does make a distinction between.


Thx ill try everything ;)


I managed to fix the issue


Io

In that case, it's good form to add 'Solved' to your title.


Log in to post a reply.

Support

Forums