Stop Camera Movement?

Post all other topics which do not belong to any other category.
FishSandwich
Smart Inserter
Smart Inserter
Posts: 1847
Joined: Sun Feb 23, 2014 3:37 pm
Contact:

Stop Camera Movement?

Post 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)
n9103
Smart Inserter
Smart Inserter
Posts: 1067
Joined: Wed Feb 20, 2013 12:09 am
Contact:

Re: Stop Camera Movement?

Post by n9103 »

I've no idea, but I'm curious/puzzled why you'd want to do this?
Colonel Failure wrote:You can lose your Ecologist Badge quite quickly once you get to the point of just being able to murder them willy-nilly without a second care in the world.
User avatar
DaveMcW
Smart Inserter
Smart Inserter
Posts: 3714
Joined: Tue May 13, 2014 11:06 am
Contact:

Re: Stop Camera Movement?

Post 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
Attachments
AutoMove_0.1.0.zip
(797 Bytes) Downloaded 102 times
FishSandwich
Smart Inserter
Smart Inserter
Posts: 1847
Joined: Sun Feb 23, 2014 3:37 pm
Contact:

Re: Stop Camera Movement?

Post 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)
User avatar
Xterminator
Filter Inserter
Filter Inserter
Posts: 981
Joined: Sun Jun 15, 2014 4:49 pm
Contact:

Re: Stop Camera Movement?

Post by Xterminator »

Dare I ask why you want to be able to do this? :p
Image Image Image
silman
Long Handed Inserter
Long Handed Inserter
Posts: 86
Joined: Fri Aug 15, 2014 12:02 am
Contact:

Re: Stop Camera Movement?

Post 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.
User avatar
rk84
Filter Inserter
Filter Inserter
Posts: 556
Joined: Wed Feb 13, 2013 9:15 am
Contact:

Re: Stop Camera Movement?

Post 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.
Test mode
Searching Flashlight
[WIP]Fluid handling expansion
[WIP]PvP gamescript
[WIP]Rocket Express
Autofill: The torch has been pass to Nexela
User avatar
cube
Former Staff
Former Staff
Posts: 1111
Joined: Tue Mar 05, 2013 8:14 pm
Contact:

Re: Stop Camera Movement?

Post 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.
FishSandwich
Smart Inserter
Smart Inserter
Posts: 1847
Joined: Sun Feb 23, 2014 3:37 pm
Contact:

Re: Stop Camera Movement?

Post 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
User avatar
DaveMcW
Smart Inserter
Smart Inserter
Posts: 3714
Joined: Tue May 13, 2014 11:06 am
Contact:

Re: Stop Camera Movement?

Post 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:
Attachments
AutoMove_0.2.0.zip
(1.09 KiB) Downloaded 101 times
User avatar
rk84
Filter Inserter
Filter Inserter
Posts: 556
Joined: Wed Feb 13, 2013 9:15 am
Contact:

Re: Stop Camera Movement?

Post 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 102 times
Test mode
Searching Flashlight
[WIP]Fluid handling expansion
[WIP]PvP gamescript
[WIP]Rocket Express
Autofill: The torch has been pass to Nexela
User avatar
micomico
Long Handed Inserter
Long Handed Inserter
Posts: 94
Joined: Thu Jul 24, 2014 10:55 pm
Contact:

Re: Stop Camera Movement?

Post by micomico »

rk84 wrote:I made rival mod with textfield :)
Shots fired!
FishSandwich
Smart Inserter
Smart Inserter
Posts: 1847
Joined: Sun Feb 23, 2014 3:37 pm
Contact:

Re: Stop Camera Movement?

Post 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
Post Reply

Return to “General discussion”