Helloo
Im making a mod that allows you to link into a Spidertron remotely - controlling it with WASD, being able to craft, and interact with the world like an engineer - but the engineer stays in one place
1. The mod successfully puts the player into Spidertron drivers seat but doesn't give control over the weapons.
Ive tried many options to force set driver_is_gunner = true but never seem to get this to work.
Entering the Spidertron normally works fine.
2. Also have an issue when switching to the Spidertron it creates an inventory as if the player was opening the gui - when switching back to the player - the items in the inventory are lost.
At this point I can imagine this hasn't been done yet because it can't be done
Spidertron control help
Re: Spidertron control help
First you need to create a dummy gunner.
Then you give the gunner a target.
When you are done, you should clean up the dummy gunner.
Code: Select all
/c
spidertron = game.player.selected
global.gunner = spidertron.surface.create_entity{
name = "character",
force = spidertron.force,
position = spidertron.position
}
spidertron.set_passenger(global.gunner)
spidertron.driver_is_gunner = false
Code: Select all
/c
enemy = game.player.selected
global.gunner.shooting_state = {state=defines.shooting.shooting_enemies, position=enemy.position}
Code: Select all
/c
global.gunner.destroy()
Re: Spidertron control help
This still didn't allow the player to use the weapons but did set me on the right track
I created a dummy engineer to transfer the player into and teleported them into the driving seat. Allowing the player to control the weapons as well
Thank you!
I created a dummy engineer to transfer the player into and teleported them into the driving seat. Allowing the player to control the weapons as well
Thank you!