Search found 17 matches

by Kill3rCat
Thu Aug 18, 2016 2:25 pm
Forum: Modding help
Topic: Complementary tech
Replies: 2
Views: 853

Re: Complementary tech

Hmm, I didn't think of that. I was trying to do it all inside the technology prototype file (derp). Thanks.
by Kill3rCat
Thu Aug 18, 2016 11:05 am
Forum: Modding help
Topic: Complementary tech
Replies: 2
Views: 853

Complementary tech

Hello, it's me again... Is it possible to have complementary technologies in Factorio? For example: Two technologies, "tech-1" and "tech-2". "tech-1" unlocks recipe "recipe-1", "tech-2" unlocks "recipe-2". When both are researched, "re...
by Kill3rCat
Wed Aug 17, 2016 5:31 pm
Forum: Modding help
Topic: Attempt to index nil value
Replies: 14
Views: 6942

Re: Attempt to index nil value

@Nexela: Most enlightening, thank you. I don't like to copy other people's code, on a matter of pride (whatever I have left, after embarassing myself totally in this thread :lol: ). I will however look at what you've written, and incorporate parts of it into my existing code. 'Inspiration', shall we...
by Kill3rCat
Tue Aug 16, 2016 9:14 pm
Forum: Modding help
Topic: Attempt to index nil value
Replies: 14
Views: 6942

Re: Attempt to index nil value

@Nexela: Player is the index, in my code. I think so, anyway local player = game.players[event.player_index] Therefore, player.index would be the same as event.player_index.index would it not? Also, I didn't know arrays could have fields, I thought they could only have cell entries. @Adil: I see, th...
by Kill3rCat
Tue Aug 16, 2016 2:43 pm
Forum: Modding help
Topic: Attempt to index nil value
Replies: 14
Views: 6942

Re: Attempt to index nil value

Hmmm... fresh problems. I hope it's fine to post in this thread, now that the problem in the OP is resolved? Try as I might, I cannot figure out the source of this issue. For some reason, it would appear that the data isn't being saved. No errors this time, however. script.on_event(defines.events.on...
by Kill3rCat
Tue Aug 16, 2016 2:06 pm
Forum: Modding help
Topic: Attempt to index nil value
Replies: 14
Views: 6942

Re: Attempt to index nil value

Well, that worked! Errors no more.

Thanks to you fine chaps who took the time to reply, you've probably saved me a fair few hours of feverish Googling and headscratching.
by Kill3rCat
Tue Aug 16, 2016 1:55 pm
Forum: Modding help
Topic: Attempt to index nil value
Replies: 14
Views: 6942

Re: Attempt to index nil value

@Nexala: "player = game.players[player_index] -- this is "the player" playerdatafrommod = global.players[player_index] -- this is "the players data stored from my mod"" Yes, but the problem with that solution is that (I think) it could only store one piece of data per p...
by Kill3rCat
Tue Aug 16, 2016 1:05 pm
Forum: Modding help
Topic: Attempt to index nil value
Replies: 14
Views: 6942

Re: Attempt to index nil value

Yes, I thought that might be the case. However, upon addding global.ammorrack[player] = player to the code (just above the threee lines entering into the array near the bottom), I get a different error; on_player_ammo_inventory_changed (ID 36) LuaPlayer doesn't contain key 1. stack traceback: __Plac...
by Kill3rCat
Tue Aug 16, 2016 11:48 am
Forum: Modding help
Topic: Attempt to index nil value
Replies: 14
Views: 6942

Attempt to index nil value

I'm rather new to Lua, though I have dabbled in Java and C#. I've been encountering the following problem, and have had no luck in fixing it: Error while running event on_player_ammo_inventory_changed (ID 36) __Placeholdername__/control.lua:29: attempt to index field '?' (a nil value) Code in questi...
by Kill3rCat
Mon Aug 15, 2016 1:30 pm
Forum: Mods
Topic: [MOD 0.12.20+] Misanthrope 0.3.7 -- Better Biter Mechanics
Replies: 179
Views: 112414

Re: [MOD 0.12.20+] Misanthrope 0.3.7 -- Better Biter Mechanics

This mod is lovely, but I've encountered certain problems. Not glitches or bugs; as far as I can see the mod works perfectly... more that it's a bit... overwhelming. I like the spawning of huge armies consisting of hundreds of units on my doorstep, since it does indeed make the game more challenging...
by Kill3rCat
Mon Aug 15, 2016 9:06 am
Forum: Modding help
Topic: Prevent deletion of empty magazines
Replies: 5
Views: 1404

Re: Prevent deletion of empty magazines

Actually, I think you just gave me the solution. Thanks very much; you've been most helpful.

Also, I have to say - I love your profile picture.
by Kill3rCat
Sun Aug 14, 2016 9:12 pm
Forum: Modding help
Topic: Prevent deletion of empty magazines
Replies: 5
Views: 1404

Re: Prevent deletion of empty magazines

I see, thank you. I'll try that. So, I presume, count the number of magazines in the player's inventory whenever the inventory is changed, and then add the appropriate number of cells. However, when the player manually drops off stuff from his inventory into a container, that would trigger the scrip...
by Kill3rCat
Sun Aug 14, 2016 2:49 pm
Forum: Modding help
Topic: Prevent deletion of empty magazines
Replies: 5
Views: 1404

Prevent deletion of empty magazines

So... I am working on a mod, which adds a couple new weapons and their corresponding ammo types (power cells). Now, I scoured through base and core, and couldn't find the scripts responsible for deleting empty magazines. Is there any way to prevent the deletion of an empty magazine (or, alternativel...
by Kill3rCat
Fri Aug 12, 2016 12:04 pm
Forum: Modding help
Topic: Weapon firing arcs
Replies: 5
Views: 1333

Re: Weapon firing arcs

That's not quite what I mean; I am talking about preventing the player from firing the weapons of the vehicle they are in. With a little bit of trig, I am sure I could mock up a firing arc restriction.
by Kill3rCat
Fri Aug 12, 2016 11:15 am
Forum: Modding help
Topic: Weapon firing arcs
Replies: 5
Views: 1333

Re: Weapon firing arcs

Is there any way to prevent the player from firing the weapon, then?
by Kill3rCat
Wed Aug 10, 2016 7:47 pm
Forum: Modding help
Topic: Weapon firing arcs
Replies: 5
Views: 1333

Weapon firing arcs

I hope this is the right subforum to post this...

Is there any way to limit a vehicle's weapon firing ability to an arc in front of the vehicle (i.e. 45')? Some weapons just shouldn't be able to fire in a 360' arc.
by Kill3rCat
Wed Aug 10, 2016 12:30 am
Forum: Mods
Topic: [MOD 0.12.x] Aircraft
Replies: 65
Views: 102776

Re: [MOD 0.12.x] Aircraft

Now, damn. If only there were a mod with the utility of this mod, and the take-off/landing mechanics of the 'Raven' mod...

Go to advanced search