The International Simutrans Forum

Development => Scripting Scenarios and AI => Topic started by: koa_jp on March 12, 2023, 06:11:53 AM

Title: Re: pak64 build a station using scripts
Post by: koa_jp on March 12, 2023, 06:11:53 AM
What's GCG1TrainStop & GCG2TrainStop in default pak64 pakset?
when I'm making simutrans script with using the follow code building station,
GCG1TrainStop & GCG2TrainStop is included in return value list.

building_desc_x.get_available_stations(building_desc_x.station, wt_rail, good_desc_x.passenger)
But GCG1TrainStop & GCG2TrainStop is not exist in railway tool.
and simutrans crashed with the follow code.

command_x.build_station(our_player, tile, "GCG2TrainStop")
Title: Re: Re: pak64 build a station using scripts
Post by: Andarix on March 12, 2023, 09:30:37 AM
Quote from: koa_jp on March 12, 2023, 06:11:53 AM...
building_desc_x.get_available_stations(building_desc_x.station, wt_rail, good_desc_x.passenger)...

local station_list = building_desc_x.get_available_stations(building_desc_x.station, wt_rail, good_desc_x("Passagiere"))

good_desc_x("Passagiere")

You must use the object name from the good file.

command_x.build_station(pl, tile, building_desc_x("GCG2TrainStop"))
Title: Re: Re: pak64 build a station using scripts
Post by: Dwachs on March 12, 2023, 09:38:49 AM
good_desc_x.passenger and good_desc_x.mail are fine, see http://dwachs.github.io/simutrans-sqapi-doc/classgood__desc__x.html

Edit: Crash should be fixed in r10885. Thanks for reporting!