[0.12.10] Sript doesn't actually put character in vehcle.

This subforum contains all the issues which we already resolved.
User avatar
Adil
Filter Inserter
Filter Inserter
Posts: 945
Joined: Fri Aug 15, 2014 8:36 pm
Contact:

[0.12.10] Sript doesn't actually put character in vehcle.

Post 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.
I do mods. Modding wiki is friend, it teaches how to mod. Api docs is friend too...
I also update mods, some of them even work.
Recently I did a mod tutorial.
posila
Factorio Staff
Factorio Staff
Posts: 5359
Joined: Thu Jun 11, 2015 1:35 pm
Contact:

Re: [0.12.10] Sript doesn't actually put character in vehcle.

Post 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.
User avatar
Adil
Filter Inserter
Filter Inserter
Posts: 945
Joined: Fri Aug 15, 2014 8:36 pm
Contact:

Re: [0.12.10] Sript doesn't actually put character in vehcle.

Post 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.
I do mods. Modding wiki is friend, it teaches how to mod. Api docs is friend too...
I also update mods, some of them even work.
Recently I did a mod tutorial.
Rseding91
Factorio Staff
Factorio Staff
Posts: 14337
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [0.12.10] Sript doesn't actually put character in vehcle.

Post by Rseding91 »

Thanks for the report. This is now fixed for 0.12.11.
If you want to get ahold of me I'm almost always on Discord.
Post Reply

Return to “Resolved Problems and Bugs”