(03-20-2013, 06:01 PM)ingedoom Wrote: (03-20-2013, 05:53 PM)The chaser Wrote: When making timers, the parameters (void Example ()) are always "string &in asTimer". So:
No they are not. "&in asTimer" can be changed to whatever you please.
As i said, the timers work just fine.
The '&' and 'in' are, seperately, both keywords used by AS. The name asTimer can change as that is just the name of the variable, and you can change &in too if you like but you shouldnt. string& is a string type that passes a memory address rather than the actual value to the function. Using &in means that the value of the variable cannot be modified, as opposed to say string &inout (or more simply string&) which would enable you to modify the value.
Checkout this part of the AS manual,
http://www.angelcode.com/angelscript/sdk...c_ref.html
This line,
if(ScriptDebugOn() and ! HasItem("lantern"))
Can you use 'and'? the proper operator should be && for and, but forgive me if it works your way. Doesnt look like that would be the cause of the issue anyway.
I'm pretty sure that the cause of the issue is using
void OpenDoor(string door)
I'm surprised it doesn't cause an error, but it's likely not working because OpenDoor("prison_11"); is not passing the value correctly into the function - and because you use that string as the arguments for the rest of the calls in that function (rather than hard-coding it in) it may be just that it doesn't know what to open
Try it out as
void OpenDoor(string &in door)
If that fails, add or change the AddDebugMessage call in OpenDoor to print the value of the 'door' string so that we can see if it is the name causing the problem, or if there is something wrong with the rest of the calls in that function