Search found 831 matches

by drs9999
Sun Mar 17, 2013 3:49 pm
Forum: Modding help
Topic: Change entity's force
Replies: 10
Views: 9544

Re: Change entity's force

Not sure if I undestand..
Can you give me an example, please?
by drs9999
Sun Mar 17, 2013 3:04 pm
Forum: Modding help
Topic: Change entity's force
Replies: 10
Views: 9544

Re: Change entity's force

Exactly this is the problem. It seems like that the entities which you spawn with create() belong to the neutral-force. At first I thought that this is not a big problem, because you are able to interact with them. But then I spawned a Lab next to some turrets that I built regularly. And the lab was...
by drs9999
Sun Mar 17, 2013 2:57 pm
Forum: Mods
Topic: [MOD 0.2.10] Electric Furnace that actually works
Replies: 31
Views: 27447

Re: [MOD 0.2.10] Electric Furnace that actually works

Yes, thats why I ask how he achieved it that it doesnt crash...
by drs9999
Sun Mar 17, 2013 2:49 pm
Forum: Mods
Topic: [MOD 0.2.10] Electric Furnace that actually works
Replies: 31
Views: 27447

Re: [MOD 0.2.10] Electric Furnace that actually works

since the iron ore i belive does not have an actual crafting recipe since it is a resource and you mine to get it, i could add a recipe for it and hide it from all but one crafting machine that gives you two ore after. Yes that is true, but if I try this: { "result": "iron-ore",...
by drs9999
Sun Mar 17, 2013 2:41 pm
Forum: Modding help
Topic: Change entity's force
Replies: 10
Views: 9544

Re: Change entity's force

Thanks for the info.

Then see this as a suggestion for future updates ;)
by drs9999
Sun Mar 17, 2013 8:52 am
Forum: Modding help
Topic: Change entity's force
Replies: 10
Views: 9544

Change entity's force

Is there a method or something else I can do to change the force a entity belongs to?
by drs9999
Sat Mar 16, 2013 11:21 pm
Forum: Modding help
Topic: How do I use game methods? or destroy?
Replies: 49
Views: 19186

Re: How do I use game methods? or destroy?

I only tested:

Code: Select all

if event.name == "onplayerdied" then game.getplayer().print("DEAD") end
The message is only displayed if the player dies and NO player-port is built before.
by drs9999
Sat Mar 16, 2013 11:10 pm
Forum: Modding discussion
Topic: [0.2.10] Modloader
Replies: 6
Views: 9529

Re: [0.2.10] Modloader

nope. A quick test with game.onevent = function(event) if event.name =="oninit" then game.getplayer().insert{name="wooden-chest", count=100} end if event.name =="onload" then game.getplayer().insert{name="wooden-chest", count=100} end end Dont give me anything...
by drs9999
Sat Mar 16, 2013 9:32 pm
Forum: Modding discussion
Topic: [0.2.10] Modloader
Replies: 6
Views: 9529

Re: [0.2.10] Modloader

why not? ;)

So I see no reason why to restrict the functions a mod is able/allowed to use.
by drs9999
Sat Mar 16, 2013 9:23 pm
Forum: Modding help
Topic: How do I use game methods? or destroy?
Replies: 49
Views: 19186

Re: How do I use game methods? or destroy?

yes i changed my opinion.
the onplayerdied event exist.

but sadly it seems that the onplayerdied event isnt called when the player can respawn. but you already noticed that before.
by drs9999
Sat Mar 16, 2013 9:10 pm
Forum: Modding help
Topic: How do I use game methods? or destroy?
Replies: 49
Views: 19186

Re: How do I use game methods? or destroy?

Hmm..
Another idea:
Try "entity.destroy()" instead of "entity.destroy()"

Very unsure if this will work, but it is worth a try ( if you didnt tried it, already)
by drs9999
Sat Mar 16, 2013 8:46 pm
Forum: Modding discussion
Topic: [0.2.10] Modloader
Replies: 6
Views: 9529

Re: [0.2.10] Modloader

Did you notice that you didnt included the oninit, onsave and onload functions?

Btw. the CC-Mod already use a similar system.

But yeah a programm that do the copy+paste work etc. for you would be pretty well and a must-have in my opinion.
by drs9999
Sat Mar 16, 2013 8:36 pm
Forum: Modding help
Topic: How do I use game methods? or destroy?
Replies: 49
Views: 19186

Re: How do I use game methods? or destroy?

I dont believe that this event is implemented, too. But les say it is, then it is important to know how then dead of the player is handled in-game. Will the end-screen instantly pop up (with a call of the onplayerdied event parallel) or will it call the event first, execute the code in it and only i...
by drs9999
Fri Mar 15, 2013 11:34 pm
Forum: Modding help
Topic: How do I use game methods? or destroy?
Replies: 49
Views: 19186

Re: How do I use game methods? or destroy?

I think this should work: local entities = game.findentities{ topleft = {x = game.getplayer().position.x-0.5, y = game.getplayer().position.y-0.5}, bottomright = {x = game.getplayer().position.x + 0.5 , y = game.getplayer().position.y + 0.5}} for i,entity in ipairs(entities) do if (entity.name == &q...
by drs9999
Fri Mar 15, 2013 11:18 pm
Forum: Modding help
Topic: How do I use game methods? or destroy?
Replies: 49
Views: 19186

Re: How do I use game methods? or destroy?

So in short. You have to find the specific entity somehow. At the moment "findentities" and "event.createdentity" come to my mind only. For example the following code will destroy a placed entity instantly: if event.name == "onbuiltentity" then event.createdentity.destr...
by drs9999
Fri Mar 15, 2013 11:08 pm
Forum: Modding help
Topic: How do I use game methods? or destroy?
Replies: 49
Views: 19186

Re: How do I use game methods? or destroy?

Ah ok, Here it is: local entities = game.findentities{ topleft = -- scan the actual field {x = glob.field[i].position.x, y = glob.field[i].position.y}, bottomright = {x = glob.field[i].position.x + 8 , y = glob.field[i].position.y + 8}} local k = 0 for _,entity in ipairs(entities) do -- and count th...
by drs9999
Fri Mar 15, 2013 10:52 pm
Forum: Modding help
Topic: How do I use game methods? or destroy?
Replies: 49
Views: 19186

Re: How do I use game methods? or destroy?

First of all, are you sure that an event "onplayerdied" exists? Also entity.remove(X) wont work unless you defined "entity" somewhere and defined a function "remove" somewhere in it. I only know table.remove(X). This will delete the first element of X, where X is a tabl...
by drs9999
Fri Mar 15, 2013 8:59 pm
Forum: Mods
Topic: [MOD 0.2.10] Electric Furnace that actually works
Replies: 31
Views: 27447

Re: [MOD 0.2.10] Electric Furnace that actually works

May I ask how you achieve that? The only way to do that that comes to my mind is that you changed the vanilla-recipe and in that case the furnace will do the same. actualy i could it would have to be like i put in one iron ore and get two out I am probably wrong, but I am relative sure that I tried ...
by drs9999
Fri Mar 15, 2013 7:14 pm
Forum: Implemented mod requests
Topic: An item beeing able to have more than one crafting recipes
Replies: 2
Views: 3683

Re: An item beeing able to have more than one crafting recip

Started to use the name of the recipe in json definition of recipe, this allows different recipes for the same product
Ready for 0.3.0 :D
by drs9999
Fri Mar 15, 2013 4:14 pm
Forum: Questions, reviews and ratings
Topic: [MOD 0.12.x] Treefarm REDUX (DISCONTINUED)
Replies: 438
Views: 328498

Re: [MOD 0.2.10] Treefarm

Nah... I should doublecheck everything before I write anything... I said that chests and furnaces can be rotated, because I read it on the Wiki, there it says: "Entities that are not rotatable naturally (like chest or furnace) can't be set to be rotable. " (It is part of the setrotable()- ...

Go to advanced search