I've got a string called 'tempstring' that holds the name of an object I want to give to the player ... so I'm trying to use the 'move object to' function to move it to the player ...
my code looks like:
MoveObject (tempstring, player)
but when I run it, I get :
Error running script: Error compiling expression 'object': RootExpressionElement: Cannot convert type 'String' to expression result of 'Element'
since 'expression' is one of the options for the move object command I assume the problem is with my expression ... so what am I doing wrong with my expression?
Since this is just a "what can I do and how do I do it" test, tempstring only refers to one object ... 'sword' ... but eventually, I want to use a dictionary to assign a value to the tempstring ... for things like giving the player random objects or selecting and giving the player an object using a showmenu command ...
ender
05 Aug 2011 02:31
Never mind. I figured this out ... but in case anyone wants to know ...
I solved this by creating an object attribute on the game object named tempobj ... then, in my script ... I set the value of game.tempobj to 'sword' ... and then I was able to use game.tempobj in the moveObject command ...