Combine писал(а):- Код: Выделить всё
Train newTrain = World.CreateTrain(currentVehicleKUID, me, "out_track0", 60.0, true);
В АПИ нет такого вызова, с 3м парамером типа float.
Есть. Я же не сам это придумал, а взял это из исходников объекта 'Portal'
А вот - выдержка из документации по API:
public native Train World.CreateTrain ( KUID consist[],
Buildable obj,
string trackName,
float position,
bool direction
)
Creates a train consist on the specified track of a Buildable scenery object.
Due to the nature of industry tracks being limited in size, it is advised that this method be used very carefully. You really need to know the length of the consist you are creating as well as the length and orientation of the track section as well to use this method effectively.
This method was intended to be used for purposes like creating a vehicle or two on an industry's track, not creating big consists. You could of course create a big consist if enough track is available, but that's not really what it is meant for.
Parameters:
consist An array of KUIDs of vehicles that make up the train.
obj Buildable object where track to create the train on can be found.
trackName Name of the track to create the train on.
position Position of where the consist is to be started. This is a distance in meters measured from where the track section starts.
direction Orientation of the train consist relative to the direction of the track.
Returns :
Returns a valid Train if the consist was successfully created, null otherwise.
See also:
SceneryWithTrack.GetAttachedTrack(), Industry.HasTrack()
Combine писал(а):По сабжу. А зачем это нужно?
Хотел исправить портал, чтобы он не забывал имена вагонов, которые он должен вернуть. Описание проблемы - см. в
http://www.railunion.net/forum12/topic7565.html