x


Go to object when hits = 0

well basically, i'am makeing a stragety game and i'ave encoutrned a problem, i'ave got a lumber jack to cut down tress, the harvest script is working but i would like it when it's hit a tree 5 times it goes back to his hut to drop off the wood before going back. but i don't know how to script that, (it's only the going back to a certain object when hits = 5)

more ▼

asked Mar 17 '12 at 05:40 PM

09jgriffin gravatar image

09jgriffin
23 4 12 15

This question is extremely ambiguous and presents no actually helpful information whatsoever. From what I can tell from your frankly poorly written question, "it's only the going back to a certain object when hits = 5)" should be exactly what you want?

Maybe try stepping into our shoes and visualise how hard it is to discern what someone means when it's asked like that.

Mar 18 '12 at 01:47 AM Kleptomaniac
(comments are locked)
10|3000 characters needed characters left

2 answers: sort voted first

im not a good scripter but aint (curent position - shedposition = distance to get back)

then use x,y,z translate to get back to it with the distance you get from the calcul from abouve then if distance <= 0 , somehting else happen liek going back to another tree

more ▼

answered Mar 18 '12 at 06:22 AM

quakeman00 gravatar image

quakeman00
-9 2 4 5

(comments are locked)
10|3000 characters needed characters left

Might want to include a check everytime you add a a hit. Something like this(provided I dont know how you've done your code)

function HitTree(){
hitCount+=1;
if(hitCount == 5){
    hitCount = 0;
}

}

is that what your looking for?

more ▼

answered Mar 18 '12 at 04:57 AM

Eli Davis gravatar image

Eli Davis
233 11 14 15

(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x1937

asked: Mar 17 '12 at 05:40 PM

Seen: 237 times

Last Updated: Mar 18 '12 at 06:22 AM