Scripts / Simplified Collectible with Prompt

Author
Message
tomjscott
User Banned
Posted: 10th May 2014 16:38 Edited at: 15th May 2014 16:11
OK, so here's my first tiny contribution to the scripting section. I have many objects in my game that I want the player to collect to perform tasks and I wanted to display a prompt of what that object is when they are in range. It quickly became obvious that I'd be copying and pasting the same code over and over again so I decided to make some stuff global and simplify the process.



Here are 2 global functions that help.







To use this, just call Collectible in an object that you want to be collected.







The only caveat is that if you have 2 objects in close proximity and are in range of them both then this would be problematic. I have some ideas on how you could display a concatenated string of multiple objects and if I need it myself then I'll post the code here at that time.



You can easily change the ranges or even make them additional parameters to the Collectible function.



Edit: This is free for any use and you don't need to give credit.
DennisW
15
Years of Service
User Offline
Joined: 15th Jun 2008
Location: Ohio
Posted: 12th May 2014 01:48
Very nice tomjscott



I will give it a try THANKS!



Dennis

Ham and Eggs Breakfast

The Chicken was involved the Pig was Committed

AGK Community Tester
almightyhood
10
Years of Service
User Offline
Joined: 9th Oct 2013
Location:
Posted: 12th May 2014 02:11
I have had the same issue with over lapping scripts prompts . lessening the check distance alittle and some slightly different placings fixed it for me though.

evga GeForce gtx 750 ti boost2.0 2gb gddr5. win 8.1 quad core 4gb ram.
PM

Login to post a reply

Server time is: 2024-04-26 16:03:31
Your offset time is: 2024-04-26 16:03:31