Jump to content
Sign in to follow this  
thegunnysgt

How to Add/Remove Actions using distances

Recommended Posts

I have 3 Static Weapons that I want to be able to use a truck to pick them up and haul them out the battlefield. They really aren't being picked up, but just moved to another location on the map using setpos until you get to where you want them in the truck.

So when the truck gets into a certain distance, the action appears for one of the 3 weapons, each action is named after is weapon so you know what you're selecting if you are close enough to more than one at a time. If they leave the specified distance the all actions are removed, unless they get closer again.

For the remove action I want to be able to have it remove the action that is being selected and then make another action appear in it's place when something it being "hauled" and then removed when it is complete.

Sorry for the confusion, trying to explain it best I can.

So when the static weapon is being selected to begin the haul when within a certain distance the added action gets replaced with the action to end the haul. It would have to be in some sort of loop as I want this to happen all the time. This would need to be possible for up to 3 static weapons.

Share this post


Link to post
Share on other sites

Are you asking how to do that or are you having a specific problem with your script?

The functions sound a lot like how I did my expanded cargo drop script, maybe you can find something in there to help?

Share this post


Link to post
Share on other sites

I got it working. It pretty rough, but its working. I could get it working before I asked, but that was using a script for each object as I wanted to try to keep my script count down and try to combine them into one script. Well that didn't work, it turned out to be a really big mess. But I got something working and I'm leaving at that.

Thanks though, for the link.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×