Page 1 of 1
[0.12.10] Sript doesn't actually put character in vehcle.
Posted: Sun Oct 04, 2015 11:10 pm
by Adil
If you set the 'vehicle" field of a train to character, the character will disappear and will stop colliding, but in any other respect it'll still be considered staying there.
If the char was enemy, you'll be able to shoot at that empty space for damage.
If you force it out of train by script, it'll appear near to where it was loaded into train.
If character had active equipment, it'd act as if the character is still staying there.
Re: [0.12.10] Sript doesn't actually put character in vehcle.
Posted: Mon Oct 05, 2015 10:26 am
by posila
Could you please post here exact commands you are using in the script to set vehicle field? As far as I know the field is read only and can't be written to.
Re: [0.12.10] Sript doesn't actually put character in vehcle.
Posted: Mon Oct 05, 2015 3:40 pm
by Adil
The help method report "passenger" field of vehicle to be [RW]
Commands used were like this: (train was built earlier)
Code: Select all
/c surf=game.get_surface(1); player=game.player;
/c pos=game.player.position;
/c ents=surf.find_entities_filtered{area={{pos.x-1,pos.y-1},{pos.x+1,pos.y+1}},type='locomotive',force=game.forces.enemy}
/c surf.create_entity{name='player',position=player.position,force=game.forces.enemy}
/c ents[1].passenger=p
Then target marker would still point the former position of enemy character. And it'll still be there in any respect except for collision and drawing. The game only updates character position when it's controlled by player.
It would be nice to actually have this ability.
Re: [0.12.10] Sript doesn't actually put character in vehcle.
Posted: Tue Oct 06, 2015 2:08 am
by Rseding91
Thanks for the report. This is now fixed for 0.12.11.