Page 1 of 1

Stop Camera Movement?

Posted: Mon Sep 22, 2014 1:20 am
by FishSandwich
I'm not sure where a post like this belongs, so feel free to move it if it's not meant to be here.

I'm trying to find a way of making the player move independently of the camera. For example, what I want to do is make the camera stay still and have the player move off the screen. Does anyone know if this is possible with a console command or mod? (I know that the opposite is possible with game.player.character = nil)

Re: Stop Camera Movement?

Posted: Mon Sep 22, 2014 1:38 am
by n9103
I've no idea, but I'm curious/puzzled why you'd want to do this?

Re: Stop Camera Movement?

Posted: Mon Sep 22, 2014 3:20 am
by DaveMcW
Here is a proof-of-concept mod that manipulates character position.

How to use:

Code: Select all

remote.call("AutoMove", "north")
game.player.character = nil
remote.call("AutoMove", "south")
remote.call("AutoMove", "east")
remote.call("AutoMove", "west")
remote.call("AutoMove", "speed", 5)
remote.call("AutoMove", "stop")
remote.call("AutoMove", "center")
Issues:
- No collision detection
- No animation

Re: Stop Camera Movement?

Posted: Mon Sep 22, 2014 3:38 am
by FishSandwich
Any way to keep animation? I guess more specifically what I want is to keep the camera on one spot and control the player as normal.(including being able to move it off screen)

Re: Stop Camera Movement?

Posted: Mon Sep 22, 2014 4:20 pm
by Xterminator
Dare I ask why you want to be able to do this? :p

Re: Stop Camera Movement?

Posted: Tue Sep 23, 2014 9:55 pm
by silman
Xterminator wrote:Dare I ask why you want to be able to do this? :p
Methinks Fish is going to be producing some sort of machinima made in Factorio and needs to be able to get views with the player not on screen.

Re: Stop Camera Movement?

Posted: Tue Sep 23, 2014 11:38 pm
by rk84
Seems like it has been only mentioned in changelog (0.8.0), but it is possible to read/write character states.
Example usage I had mod that copy/paste my drivingstate to other characters ontick.

I'm not sure if it is possible to read god controller state. since it has no charracter.
for god mode, you could possibly set up textfield in corner and use it to read keyport inputs.

Setting walkingstate.

Code: Select all

character.walkingstate = ( walking = boolean, direction = number )
Its a table, but I'm typing this with smartphone that has no wavy brackets in key layout.

Re: Stop Camera Movement?

Posted: Wed Sep 24, 2014 9:42 am
by cube
silman wrote:
Xterminator wrote:Dare I ask why you want to be able to do this? :p
Methinks Fish is going to be producing some sort of machinima made in Factorio and needs to be able to get views with the player not on screen.
Take a look at the trailer mod. There were several lua api calls added just to make things like this possible in trailer.

Re: Stop Camera Movement?

Posted: Wed Sep 24, 2014 10:39 am
by FishSandwich
Oh wow, I forgot about the trailer mod! I'll definitely look into that then, I think that'll definitely be easier than how I'm doing it now.. :P

Re: Stop Camera Movement?

Posted: Wed Sep 24, 2014 10:59 am
by DaveMcW
rk84 wrote: Setting walkingstate.

Code: Select all

character.walkingstate = { walking = boolean, direction = number }
Thanks, that solved animation and collision detection!

Textfield input is really awkward. I went with mouse input and an onscreen direction pad.

Updated mod:

Re: Stop Camera Movement?

Posted: Wed Sep 24, 2014 12:20 pm
by rk84
DaveMcW wrote:Textfield input is really awkward. I went with mouse input and an onscreen direction pad.
I made rival mod with textfield :)
Clicking the textfield toggle mode.
I made same kind of system as in your pad.

Code: Select all

-- Keyport inputs: S is stop. Others are directional inputs that can toggle walking.
-- QWE
-- ASD
-- ZXC
remote-move_0.1.0.zip
(1.25 KiB) Downloaded 84 times

Re: Stop Camera Movement?

Posted: Wed Sep 24, 2014 1:34 pm
by micomico
rk84 wrote:I made rival mod with textfield :)
Shots fired!

Re: Stop Camera Movement?

Posted: Thu Sep 25, 2014 4:54 pm
by FishSandwich
rk84 wrote:
DaveMcW wrote:Textfield input is really awkward. I went with mouse input and an onscreen direction pad.
I made rival mod with textfield :)
Clicking the textfield toggle mode.
I made same kind of system as in your pad.

Code: Select all

-- Keyport inputs: S is stop. Others are directional inputs that can toggle walking.
-- QWE
-- ASD
-- ZXC
remote-move_0.1.0.zip
Beautiful! This works well, thank you! To both of you. :D