Page 1 of 1

Game player build range

Posted: Fri Nov 28, 2014 10:28 am
by Lukasecicek
Hello, i did use the search button, but with no results...
I would like to make a simple mod making the player able to build at twice the range he can right now. I have found its somehow related to onbuiltentity, but i dont really have enough experience to make it work...

Can somebody point me in the right direction please?

Re: Game player build range

Posted: Fri Nov 28, 2014 11:07 am
by drs9999
If the building range isn't defined on the player-definition, which I believe isn't otherwise you probably wouldn't ask ;) you have to use a workaround.

What I could imagine is using the OnPut-event, which doesn't depend on the building-range.
So you could do the following in the event:

Code: Select all

1) check if the event-position is inside the new custom build range
2) check if the item/entity that is currently attached to the cursor can be placed there (there is a mehtod for this)
3) use game.createentity to create the entity there and decrease the item-count in the player's inventory

if 1) or 2) fails: do nothing
Drawback is that the user don't receive any feedback if the cursor is currently inside the higher building range before he actually try to build the entity.

Re: Game player build range

Posted: Fri Nov 28, 2014 12:21 pm
by Lukasecicek
Thank you very much, i will definetly try that approach, but it gets more complicated than i though :)