It is. I tried yesterday with filewrites (because the luadebug still not works). The file is risen by 5 kbyte/sec without touching any control key...
For rw2 i don't know i tried first with rw3.
New developer features.
Moderator: Moderators
-
crazyfrogbro
- Established Forum Member
- Posts: 304
- Joined: Tue Jan 18, 2011 9:09 pm
Re: New developer features.
That's tentative good news; the other issue I had in RW2 was it wasn't getting called when the control settled on it's final value...
My posts are my opinion, and should be read as such.
-
crazyfrogbro
- Established Forum Member
- Posts: 304
- Joined: Tue Jan 18, 2011 9:09 pm
Re: New developer features.
Yesterday i tried again, don't know why but it's called now only when i changed the control values. But doesn't helps much, the update still need to be run and check the player variable, what have been set now in on OnControlValueChange(). Maybe i will put beginupdate there, so it isn't activated if the loco controlled by ai. But for free roam and jump in out locos it wont get disabled after it got enabled by a player.
- CosmicDebris
- Been on the forums for a while
- Posts: 285
- Joined: Mon May 28, 2007 1:51 am
- Location: France
Re: New developer features.
I beg to differ, Sir. Anything else than "nil" or a false statement (including "false" itself of course) equates to "true" in a conditional statement (see note), including numbers and strings. I guess you were meaning "unfortunately, 0 does not mean false". This does not change your conclusion by the way.RSBen wrote:All Call functions will return 1 for true and 0 for false. Unfortunately, 0 does not mean true in LUA. You need to write Call( "GetIsPlayer" ) == 1crazyfrogbro wrote:I've found a new "feature"both of these lua script commands always returns 0 if i write out them. But always return true if it put into and if like this: if Call( "GetIsPlayer" ) thenCode: Select all
Call( "GetIsPlayer" ) Call( "GetIsEngineWithKey" )
Of course that it's player controlled or not, doesn't matters
It's a bug not feature?
Note: if 0 then print("a") else print("b") end returns "a", yet if 0==true then print("a") else print("b") end returns "b"...
Matthieu
Re: New developer features.
Yes, that's what I meant and saw my mistake after I posted. Since I haven't posted enough with this account, I have to wait for a moderator to review it, so I couldn't go back and edit itCosmicDebris wrote:I beg to differ, Sir. Anything else than "nil" or a false statement (including "false" itself of course) equates to "true" in a conditional statement (see note), including numbers and strings. I guess you were meaning "unfortunately, 0 does not mean false". This does not change your conclusion by the way.RSBen wrote:All Call functions will return 1 for true and 0 for false. Unfortunately, 0 does not mean true in LUA. You need to write Call( "GetIsPlayer" ) == 1crazyfrogbro wrote:I've found a new "feature"both of these lua script commands always returns 0 if i write out them. But always return true if it put into and if like this: if Call( "GetIsPlayer" ) thenCode: Select all
Call( "GetIsPlayer" ) Call( "GetIsEngineWithKey" )
Of course that it's player controlled or not, doesn't matters
It's a bug not feature?
Note: if 0 then print("a") else print("b") end returns "a", yet if 0==true then print("a") else print("b") end returns "b"...
Ben Laws
Any support issues, contact support@railsimulator.com. My views are my own, and do not necessarily reflect the views of RailSimulator.com.
Any support issues, contact support@railsimulator.com. My views are my own, and do not necessarily reflect the views of RailSimulator.com.
- jp4712
- Petulant Princess
- Posts: 4802
- Joined: Mon Jul 01, 2002 6:09 pm
- Location: Lichfield, Staffordshire
- Contact:
Re: New developer features.
I've cut you loose, Ben - now be a good boy!RSBen wrote:Since I haven't posted enough with this account, I have to wait for a moderator to review it, so I couldn't go back and edit itShould have just stuck with my old account
Paul
Visit the Manchester Museum of Transport, the UK's premier bus museum