Player Health
Player Health
Is there an event for detecting change to the players health, and is there a way to modify the players health?
"F**k thy hater"
-George Watsky
Feel free to contact me!
Skype: Zer0t3ch
Razer Comms: Zer0t3ch
Email: zer0t3ch@live.com
-George Watsky
Feel free to contact me!
Skype: Zer0t3ch
Razer Comms: Zer0t3ch
Email: zer0t3ch@live.com
Re: Player Health
You can modify any entity's health. It works as an attribute.
for instance
It is a good habit to check whether the character exists (game might be in the god mode for instance).
for instance
Code: Select all
game.player.character.health = game.player.character.health + 1
Re: Player Health
Thanks!slpwnd wrote:You can modify any entity's health. It works as an attribute.
for instance
It is a good habit to check whether the character exists (game might be in the god mode for instance).Code: Select all
game.player.character.health = game.player.character.health + 1
Out of curiosity, are any of the devs actively updating the wiki?
"F**k thy hater"
-George Watsky
Feel free to contact me!
Skype: Zer0t3ch
Razer Comms: Zer0t3ch
Email: zer0t3ch@live.com
-George Watsky
Feel free to contact me!
Skype: Zer0t3ch
Razer Comms: Zer0t3ch
Email: zer0t3ch@live.com
Re: Player Health
Not now, but we plan to
Re: Player Health
Hm. Does a "Docs" subboard make sense? I would like to discuss how the information in the wiki can be partitioned in more useful parts and have some ideas for that. It should also help to join some users for that job.
Cool suggestion: Eatable MOUSE-pointers.
Have you used the Advanced Search today?
Need help, question? FAQ - Wiki - Forum help
I still like small signatures...
Have you used the Advanced Search today?
Need help, question? FAQ - Wiki - Forum help
I still like small signatures...
Re: Player Health
It makes all the sense. Even though we have a lot of access to the base code via the lua stuff, there's still a lot of compiled code in the game that modders can't see, but should be documented.ssilk wrote:Hm. Does a "Docs" subboard make sense? I would like to discuss how the information in the wiki can be partitioned in more useful parts and have some ideas for that. It should also help to join some users for that job.
For example, anything in the game.<whatever> is compiled code (I think) and therefor we can only know about what's there based on what the devs put there, and there hasn't been a whole lot of dev activity lately.
"F**k thy hater"
-George Watsky
Feel free to contact me!
Skype: Zer0t3ch
Razer Comms: Zer0t3ch
Email: zer0t3ch@live.com
-George Watsky
Feel free to contact me!
Skype: Zer0t3ch
Razer Comms: Zer0t3ch
Email: zer0t3ch@live.com
Re: Player Health
bump? I'm just curious if any devs are planning on updating the wiki. I haven't looked at it lately, so I'm sorry if you already have.zer0t3ch wrote:It makes all the sense. Even though we have a lot of access to the base code via the lua stuff, there's still a lot of compiled code in the game that modders can't see, but should be documented.ssilk wrote:Hm. Does a "Docs" subboard make sense? I would like to discuss how the information in the wiki can be partitioned in more useful parts and have some ideas for that. It should also help to join some users for that job.
For example, anything in the game.<whatever> is compiled code (I think) and therefor we can only know about what's there based on what the devs put there, and there hasn't been a whole lot of dev activity lately.
"F**k thy hater"
-George Watsky
Feel free to contact me!
Skype: Zer0t3ch
Razer Comms: Zer0t3ch
Email: zer0t3ch@live.com
-George Watsky
Feel free to contact me!
Skype: Zer0t3ch
Razer Comms: Zer0t3ch
Email: zer0t3ch@live.com
Re: Player Health
I wonder whether we shouldn't just open the source for the modding part of Factorio. There are calls to the core engine so the code on itself is useless and won't even be compilable. On the other hand it is the up to date reference on what can be done with the lua interface.zer0t3ch wrote: It makes all the sense. Even though we have a lot of access to the base code via the lua stuff, there's still a lot of compiled code in the game that modders can't see, but should be documented.
The other option would be to write the comments directly into our c++ code and then use some comments / documentation extractor (ala doxygen) to generate up to date reference.
Vacation time:) But it is nearly over.zer0t3ch wrote: and there hasn't been a whole lot of dev activity lately.
Re: Player Health
Hm. I've had a project, which uses that. They opened the interface-code for everybody. The result was, that the developers found bugs, which they use to do things, that the interface wasn't thought for. The end was, that they developed a second (closed) interface, because they didn't want to maintain the "bug-is-a-feature" in the open code (by fixing the bugs they would make everything incompatible, because they all used the bugs ).slpwnd wrote:I wonder whether we shouldn't just open the source for the modding part of Factorio. There are calls to the core engine so the code on itself is useless and won't even be compilable. On the other hand it is the up to date reference on what can be done with the lua interface.
Yes. Works in all projects I have been working on very well! Inline-documentation is the only way I know, where you can document an API during development. Otherwise documentation and code run in different directions. Always.The other option would be to write the comments directly into our c++ code and then use some comments / documentation extractor (ala doxygen) to generate up to date reference.
PS: I'm sure that you know that, but for the other case I mention it: look for some autogenerators of the inline-docu. In most IDE's you'll write "/**" then enter and the inline-docu is autofilled with the information that can be collected from the method or whatever is below.
Cool suggestion: Eatable MOUSE-pointers.
Have you used the Advanced Search today?
Need help, question? FAQ - Wiki - Forum help
I still like small signatures...
Have you used the Advanced Search today?
Need help, question? FAQ - Wiki - Forum help
I still like small signatures...
Re: Player Health
Almost like javadocs?slpwnd wrote:I wonder whether we shouldn't just open the source for the modding part of Factorio. There are calls to the core engine so the code on itself is useless and won't even be compilable. On the other hand it is the up to date reference on what can be done with the lua interface.zer0t3ch wrote: It makes all the sense. Even though we have a lot of access to the base code via the lua stuff, there's still a lot of compiled code in the game that modders can't see, but should be documented.
The other option would be to write the comments directly into our c++ code and then use some comments / documentation extractor (ala doxygen) to generate up to date reference.
"F**k thy hater"
-George Watsky
Feel free to contact me!
Skype: Zer0t3ch
Razer Comms: Zer0t3ch
Email: zer0t3ch@live.com
-George Watsky
Feel free to contact me!
Skype: Zer0t3ch
Razer Comms: Zer0t3ch
Email: zer0t3ch@live.com