Page 1 of 1

car.teleport()

Posted: Mon Sep 30, 2013 6:22 am
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

Re: car.teleport()

Posted: Mon Sep 30, 2013 7:58 am
by kovarex
Wow, cool! :)
And what if you could just alter the car speed?

Re: car.teleport()

Posted: Mon Sep 30, 2013 8:44 am
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. :)

Re: car.teleport()

Posted: Mon Sep 30, 2013 2:09 pm
by ficolas
that looks awesome :3

Re: car.teleport()

Posted: Mon Sep 30, 2013 2:46 pm
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:

Re: car.teleport()

Posted: Mon Sep 30, 2013 3:46 pm
by Nirahiel
Where does that road come from ?

Re: car.teleport()

Posted: Mon Sep 30, 2013 4:00 pm
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.

Re: car.teleport()

Posted: Mon Sep 30, 2013 4:40 pm
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 :)

Re: car.teleport()

Posted: Mon Sep 30, 2013 5:36 pm
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.

Re: car.teleport()

Posted: Mon Sep 30, 2013 7:18 pm
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

Re: car.teleport()

Posted: Mon Sep 30, 2013 8:09 pm
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

Re: car.teleport()

Posted: Mon Sep 30, 2013 10:27 pm
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

Re: car.teleport()

Posted: Tue Oct 01, 2013 1:22 am
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.

Re: car.teleport()

Posted: Tue Oct 01, 2013 10:49 pm
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.

Re: car.teleport()

Posted: Mon Oct 07, 2013 4:39 pm
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

Re: car.teleport()

Posted: Mon Oct 07, 2013 7:25 pm
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 ?

Re: car.teleport()

Posted: Mon Oct 07, 2013 7:41 pm
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.

Re: car.teleport()

Posted: Mon Oct 07, 2013 9:42 pm
by slpwnd
Got to see this thread just now. It looks super awesome!

Re: car.teleport()

Posted: Tue Oct 08, 2013 1:40 am
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-)