Jump to content

Want to do a growing rocks mod,need helps


Recommended Posts

it seems some resources are Non-renewable resources,like rock,tentacle(monster or enemy i guess)when they are used up, or dead,you'll never see them in this world again.had to teleport for another world.but you have so many properties in this world,you don't want to leave.the idea is for rocks,when you dont complete exploit it up,say rocks has a 6 default workleft value.when you hit it 5 times and stop,it will grow back to normal slowly.and also change its logic to drop rocks every hit.i have finished every hit dropping one rock,but can't get it growing back.

inst.components.workable.workleft = TUNING.ROCKS_MINE
this code doesn't work,don't know why,maybe a wrong sulotion.need help.and for tentacle,i'm thinking when you killed one tentacle,just respawn a tentacle nearby,but keep in marsh area.respawn is easy.but how to judge nearby area is marsh area.it seems like a marsh area selection,then randomize position in it and some distance from player.how to query such statement in game?
Link to comment
Share on other sites

Interesting idea....off the top of my head so not exactly sure of all the steps required....- as you said, during the workable event you would drop an item if the workleft is > 1 and <= to maxwork value (6); so essentially the rock mines never get to 0 workleft and are static- then you would need to add a timer event to setup a DoInTime event callback so the game calls (at a future time you specify) a function you make to add 1 to the rock's workleft until it reaches maxwork....and remove the timer eventhandler when it does reach maxwork.- take a look at the trees code for timer events (that make them grow over time)- take a look at the pigking code for how to "thow" the rocks away from the rock mine.- I am guessing a random loot drop for rock and flint favoring rock and a chance drop for gold?EDIT:On the tentacles....I thought there was speculation that they will re-spawn during the winter in next update? In any case, I think you would want to calculate a point away from the current player position or dead tentacle's position (radially?) and I assume there is a method you can call on the map object to determine whether the tile under that point is a marsh one. Not sure of best approach for this one though.

Edited by WrathOf
Link to comment
Share on other sites

great advice,and give up adding timer to rock,i really can't get it work...:fatigue:right now simplely spawn new rock far away from player 500-1000 units,and within the map and on valid ground,good enough for me...and for tentacle still working on....EDIT:got some trouble on tentacles.have dealt with spawn new tentacle algorithm(just check tile with Midpoint circle algorithm,and judge if it is 8(marsh tile),then push all possible inst in a table,randomize a number from total number,that's it),but i can't find tentacle onDeath Event.....differ from rock,there is no "inst.remove" code inside.so how can i get the time when tentacle is dead,and execute my custom function?

Edited by noisestudio
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...