[Resolved 0.2.7] No attacks on freeplay and a little fix

This subforum contains all the issues which we already resolved.
Post Reply
Beichtvater
Burner Inserter
Burner Inserter
Posts: 10
Joined: Sat Feb 16, 2013 3:16 pm
Contact:

[Resolved 0.2.7] No attacks on freeplay and a little fix

Post by Beichtvater »

Sooo... maybe someone noticed that in freeplay creepers attack only once (maybe it's just in my version of the game (I am confused by the fact that using the gift game, but I need a couple of days to solve my problem with a credit card), or can do all the others are happy with such situation - i dont know).

However, if someone faced with the same and missed the precious natives waves, it can be arranged.

if you attentively examine savegame folder you will find a simple little script that is responsible for attacks:
(rather, it is not a script, only the current data for his work)
Image
You see, the timer, a large number in the center, isn't an integer and has many signs after a comma.

If a little to wait and look at it again, you will see that the number left lower than zero that is abnormal for time variable. Speaking roughly, it didn't work:
Image

That is what caught my attention.

control.lua file, actually body of a script, feeds from body game - freeplay.lua in lualib folder.
from it is evident that the attack is triggered when the variable is zero. exactly zero.
so this is just an alpha and still many times will change, I found a simple and fast solution of the problem:
Image

Code: Select all

      glob.untilnextattacknormal = math.ceil (glob.untilnextattacknormal)
This code, simple lua-language command which rounds number, returning it its normal state, each time after any unnatural divisions.
You have to put this line there, as shown in the screenshot, in freeplay.lua or control.lua if you want this to work in the already started game.

I selected the second line - this number (+2) determines how much will increase each subsequent attack. You can put there what you like.

very soon all your buildings will resemble something like this:
Image

On this occasion, I would like to note that it would be good to the number of attacking depended on the number of open "creeper spawners" by player (have in mind those who have noticed the player and have attacked him).
This will force to clean each open settlement and will lead to a massive attack if just walk past them.
Additionally, I would like to see an enemy attack is all the traces of the player, not just a few buildings. It's great all the harder, and will require to protect any building. Jeopardize the communications and logistics - that is what this game live.


Sooo! I want to notice that as the counter is infinite by definition, having included this option sooner or later surely you will die (you'll be pleasantly surprised if you try to edit the script.dat).
And, using this opportunity, I want to wish you what I love most desire: die well!

As always, I apologize for my English, if suddenly during reading this text your eyes wished to die.
—>>Great Old World<<—

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

Re: No attacks on freeplay and a little fix

Post by kovarex »

Hi, thank you for the debugging effort, at least you know how does it work :).
The bug was repaired in 0.2.7, insetad of checking == 0, I changed it to <= 0, but it didn't affect already created games, I'm sorry I didn't state it somewhere.
The reason the number is not integral is, that we added the random there.
The simpliest way to repair it is to copy lualib/freeplay.lua -> save/control.lua (overwrite), when you have the 0.2.7 version.

PS. The current version of the freeplay script is very very simple script we made just as starting point, we plan to enhance it when we get time to do that.
(I'm currently working on the automatic updater ....)

Post Reply

Return to “Resolved Problems and Bugs”