car.teleport()

Post Reply
User avatar
rk84
Filter Inserter
Filter Inserter
Posts: 556
Joined: Wed Feb 13, 2013 9:15 am
Contact:

car.teleport()

Post by rk84 »

It would be sweet if car would keep its orientation while teleportation.
And/Or teleport() could be extended with optional orientation parameter.

I try to make car with afterburner :lol:

http://youtu.be/bPkt-GR0Kio
Last edited by rk84 on Tue Oct 01, 2013 1:07 am, edited 1 time in total.
Test mode
Searching Flashlight
[WIP]Fluid handling expansion
[WIP]PvP gamescript
[WIP]Rocket Express
Autofill: The torch has been pass to Nexela

kovarex
Factorio Staff
Factorio Staff
Posts: 8078
Joined: Wed Feb 06, 2013 12:00 am
Contact:

Re: car.teleport()

Post by kovarex »

Wow, cool! :)
And what if you could just alter the car speed?

User avatar
rk84
Filter Inserter
Filter Inserter
Posts: 556
Joined: Wed Feb 13, 2013 9:15 am
Contact:

Re: car.teleport()

Post by rk84 »

kovarex wrote:Wow, cool! :)
And what if you could just alter the car speed?
hehe. yea that makes more sense. Though, I could add some effects with teleport. Like vibration, if really high speed or not on road/asphalt tile. I have also thinking about possibility of a script driveable car. Teleportation probably is not that best way of doing those. So yea alterable car speed would be nice. :)
Test mode
Searching Flashlight
[WIP]Fluid handling expansion
[WIP]PvP gamescript
[WIP]Rocket Express
Autofill: The torch has been pass to Nexela

ficolas
Smart Inserter
Smart Inserter
Posts: 1068
Joined: Sun Feb 24, 2013 10:24 am
Contact:

Re: car.teleport()

Post by ficolas »

that looks awesome :3

User avatar
rk84
Filter Inserter
Filter Inserter
Posts: 556
Joined: Wed Feb 13, 2013 9:15 am
Contact:

Re: car.teleport()

Post by rk84 »

ficolas wrote:that looks awesome :3
Yea it is. I can't stop driving. 8-)
I need to make more road to north and express train to get back :lol:
Test mode
Searching Flashlight
[WIP]Fluid handling expansion
[WIP]PvP gamescript
[WIP]Rocket Express
Autofill: The torch has been pass to Nexela

Nirahiel
Filter Inserter
Filter Inserter
Posts: 351
Joined: Mon Sep 23, 2013 2:18 pm
Contact:

Re: car.teleport()

Post by Nirahiel »

Where does that road come from ?

User avatar
rk84
Filter Inserter
Filter Inserter
Posts: 556
Joined: Wed Feb 13, 2013 9:15 am
Contact:

Re: car.teleport()

Post by rk84 »

Nirahiel wrote:Where does that road come from ?
I made it. I copied sand tiles/terrain and edited them bit with GIMP. Then made roads with map editor, but I forgot to set asphalt to "none" in generator so there is some big areas of asphalt.

Edit: game.gettile() works like a charm. I added small shake effect, when driving off road with afterburner.
Test mode
Searching Flashlight
[WIP]Fluid handling expansion
[WIP]PvP gamescript
[WIP]Rocket Express
Autofill: The torch has been pass to Nexela

kovarex
Factorio Staff
Factorio Staff
Posts: 8078
Joined: Wed Feb 06, 2013 12:00 am
Contact:

Re: car.teleport()

Post by kovarex »

I will add all you need to the modding intefrace to 0.7.1 so I can play with it when it is released :)

User avatar
rk84
Filter Inserter
Filter Inserter
Posts: 556
Joined: Wed Feb 13, 2013 9:15 am
Contact:

Re: car.teleport()

Post by rk84 »

kovarex wrote:I will add all you need to the modding intefrace to 0.7.1 so I can play with it when it is released :)
Cool. I think I can get rid of ~15 lines of code and don't need to add seperated fuel eater, if I get my hands on 1 or 2 properties. Consumption and burner.effectivity perhaps?

Teleport has one problem. The car can get stuck in water for example and I can't use "canplaceentity()" directly, because the car itself is in the way.
Test mode
Searching Flashlight
[WIP]Fluid handling expansion
[WIP]PvP gamescript
[WIP]Rocket Express
Autofill: The torch has been pass to Nexela

ficolas
Smart Inserter
Smart Inserter
Posts: 1068
Joined: Sun Feb 24, 2013 10:24 am
Contact:

Re: car.teleport()

Post by ficolas »

rk84 wrote:
kovarex wrote:I will add all you need to the modding intefrace to 0.7.1 so I can play with it when it is released :)
Cool. I think I can get rid of ~15 lines of code and don't need to add seperated fuel eater, if I get my hands on 1 or 2 properties. Consumption and burner.effectivity perhaps?

Teleport has one problem. The car can get stuck in water for example and I can't use "canplaceentity()" directly, because the car itself is in the way.
Check the tiles :)

Alsp do you plan on adding a time travel or something? XD

User avatar
rk84
Filter Inserter
Filter Inserter
Posts: 556
Joined: Wed Feb 13, 2013 9:15 am
Contact:

Re: car.teleport()

Post by rk84 »

ficolas wrote:Check the tiles :)
I guess that could work. Even though it still can teleports inside other entities, but one of the entities will most likely die in hit so its not stuck situation.
ficolas wrote:Alsp do you plan on adding a time travel or something? XD
Yea mayby I use wormholes :D
Test mode
Searching Flashlight
[WIP]Fluid handling expansion
[WIP]PvP gamescript
[WIP]Rocket Express
Autofill: The torch has been pass to Nexela

n9103
Smart Inserter
Smart Inserter
Posts: 1067
Joined: Wed Feb 20, 2013 12:09 am
Contact:

Re: car.teleport()

Post by n9103 »

If you want the car to go faster, just mess with the 'acceleration per energy' line, or that one and the friction lines if you want to change how far it coasts. (Both in the car's definition in entities.lua)
I'd also consider changing the rate of fuel consumption for the increased speed, higher for faster but expensive trips, or lower for slower but more economic.

Be very wary of making these adjustments, as the car's durability, if below near-limitless amounts, means it's usually a one use vehicle for speeds significantly above stock values.
In either case, *don't* use anything remotely close to .01 for the accel value, assuming you want to have any sort of reaction time.
Values above that will test theoretical limits of the game engine to render light speed :P
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
rk84
Filter Inserter
Filter Inserter
Posts: 556
Joined: Wed Feb 13, 2013 9:15 am
Contact:

Re: car.teleport()

Post by rk84 »

n9103 wrote:...consumption for the increased speed, higher for faster but expensive trips...
Yup thats what I'm after. Afterburner is inefficient in terms of fuel consumption.
Test mode
Searching Flashlight
[WIP]Fluid handling expansion
[WIP]PvP gamescript
[WIP]Rocket Express
Autofill: The torch has been pass to Nexela

n9103
Smart Inserter
Smart Inserter
Posts: 1067
Joined: Wed Feb 20, 2013 12:09 am
Contact:

Re: car.teleport()

Post by n9103 »

So slightly decrease the accel number and significantly increase the consumption?
You'll get a faster but much less efficient car.

If you're looking into making a triggered/on demand speed boost, can't say I can help, since there isn't any action key that you might be able to map to triggering the speed boost.
If you're just looking for an alternative/accessory to the normal car, that you could swap into without much of a problem, I think you can create it now, with only needing new graphics.
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.

kovarex
Factorio Staff
Factorio Staff
Posts: 8078
Joined: Wed Feb 06, 2013 12:00 am
Contact:

Re: car.teleport()

Post by kovarex »

So I added 3 modifier to the car, that will be available in 0.7.1, I hope it is all needed, looking forward to get hands on your mod :)
https://forums.factorio.com/wiki/inde ... le=Lua/Car

User avatar
Math3vv
Long Handed Inserter
Long Handed Inserter
Posts: 99
Joined: Sun Oct 06, 2013 10:47 am
Contact:

Re: car.teleport()

Post by Math3vv »

rk84 wrote:I copied sand tiles/terrain and edited them bit with GIMP.
Could send or explaine to me the code on how you made a new tile. or did you just replace the sand ?
and did you put the new tile in the "_base_" or in the "mod" folder ?

ficolas
Smart Inserter
Smart Inserter
Posts: 1068
Joined: Sun Feb 24, 2013 10:24 am
Contact:

Re: car.teleport()

Post by ficolas »

Math3vv wrote:
rk84 wrote:I copied sand tiles/terrain and edited them bit with GIMP.
Could send or explaine to me the code on how you made a new tile. or did you just replace the sand ?
and did you put the new tile in the "_base_" or in the "mod" folder ?
Copy the prototype of the tile, add it to a lua file with data:extend, and include it in your data.lua file as you do with any other entity/item/ w/e prototype.

slpwnd
Factorio Staff
Factorio Staff
Posts: 1835
Joined: Sun Feb 03, 2013 2:51 pm
Contact:

Re: car.teleport()

Post by slpwnd »

Got to see this thread just now. It looks super awesome!

User avatar
rk84
Filter Inserter
Filter Inserter
Posts: 556
Joined: Wed Feb 13, 2013 9:15 am
Contact:

Re: car.teleport()

Post by rk84 »

kovarex wrote:So I added 3 modifier to the car, that will be available in 0.7.1, I hope it is all needed, looking forward to get hands on your mod :)
https://forums.factorio.com/wiki/inde ... le=Lua/Car
Yay. I can't wait for 0.7.1
ficolas wrote:
Math3vv wrote:
rk84 wrote:I copied sand tiles/terrain and edited them bit with GIMP.
Could send or explaine to me the code on how you made a new tile. or did you just replace the sand ?
and did you put the new tile in the "_base_" or in the "mod" folder ?
Copy the prototype of the tile, add it to a lua file with data:extend, and include it in your data.lua file as you do with any other entity/item/ w/e prototype.
Yes. I copied from "\data\base\prototypes\tile\tiles.lua". If you want generator to use your tiles you need to define noise-layer too like in "noise-layers.lua". If not then you can remove the generator table from tile definition.
slpwnd wrote:Got to see this thread just now. It looks super awesome!
Thanks. 8-)
Test mode
Searching Flashlight
[WIP]Fluid handling expansion
[WIP]PvP gamescript
[WIP]Rocket Express
Autofill: The torch has been pass to Nexela

Post Reply

Return to “Implemented mod requests”