Class World1
From TrainzOnline
(Difference between revisions)
m (1 revision) |
m |
||
Line 1: | Line 1: | ||
__FORCETOC__ | __FORCETOC__ | ||
− | *[[TrainzScript | + | *[[TrainzScript Language Reference|API Hierarchy]] |
**World1 | **World1 | ||
<br> | <br> |
Latest revision as of 02:43, 10 February 2010
- API Hierarchy
- World1
- World1 is an extension of the original World class.
- This class was originally made separate from World because in earlier versions of Trainz, it was not possible to modify a .gs file without breaking compatibility. Even though later versions don't have this problem, scenarios written for SP3 or UTC still expect to find certain methods in World1, so World1 is retained to maintain backward compatibility.
Contents |
[edit] CreateTrain
public native Train CreateTrain(string consistName, string trackmarkName, bool direction)
- Notes
- This method is obsolete and included for backwards compatibility only.
- Use TrainUtil.CreateTrainFromSoup() instead.
[edit] SetDCCMode
public native void SetDCCMode(bool dccMode)
- Parameters
- dccMode = true for DCC mode, false for Cabin control.
- Returned Value
- None
- Syntax
World1.SetDCCMode(true);
- Notes
- This method provides script access to the control mode which is normally set using the Startup Options rule.
[edit] SetDerailLevel
public native void SetDerailLevel(int level)
- Parameters
- level = Derail level in the range 0 to 2
- Returned Value
- None
- Syntax
World1.SetDerailLevel(1);
- Notes
- This method provides script access to the derailment realism options which are normally set using the Startup Options rule.
[edit] Related Methods