Scripts / Text Based Compass

Author
Message
!nullptr
Forum Support
9
Years of Service
User Offline
Joined: 27th Mar 2015
Location: Australia
Posted: 14th Apr 2015 23:44
I needed a compass for in game and took a read of Avram's thread with the imaged version, a nice job. BUT I needed something more accurate (I need compass bearings in a development project underway). I also wanted non image based.

Since it works well with (almost) zero resource use I thought it might be of interest to others. Instructions for use are very simple and included with the code.

In short, add any entity near player start, assign compass.lua, set to dynamic. Always Active MUST be on for this to work out of range. Can be turned on/off via keyboard and includes a flag to turn on/off if you want a player to "find" a compass.

As always, happy to answer questions.



Usage caveat: If you mess with it, YOU fix it.
E&OE
PM
!nullptr
Forum Support
9
Years of Service
User Offline
Joined: 27th Mar 2015
Location: Australia
Posted: 15th Apr 2015 01:13
Oops. Best to put an image in too I suppose.

Attachments

Login to view attachments
PM
Pirate Myke
Forum Support
13
Years of Service
User Offline
Joined: 31st May 2010
Location: El Dorado, California
Posted: 15th Apr 2015 01:42 Edited at: 15th Apr 2015 01:47
Looks very nice. Thanks for the script.

Edit: Just tried it out. Brilliant. Thanks again.
Intel(R) Core(TM)2 Quad CPU Q6600 @ 2.40GHz, 2400 Mhz, 4 Core(s), 4 Logical Processor(s), 8gb RAM, Nvidia gtx660, Windows 7 Pro 64bit

HarryWever
3D Media Maker
14
Years of Service
User Offline
Joined: 14th Jan 2010
Location: below Sea level
Posted: 15th Apr 2015 07:26
That is a really nice script..
Thanks for that.

Cheers
Harry
Harry
PM
AceRimmer
Reviewed GameGuru on Steam
9
Years of Service
User Offline
Joined: 28th Feb 2015
Playing: classic British heavy metal mostly
Posted: 18th Apr 2015 19:30
thanks, !nullptr - that's really neat. really appreciate it when you guys comment the scripts so well, its very helpful to those of us starting to learn the scripting.
!nullptr
Forum Support
9
Years of Service
User Offline
Joined: 27th Mar 2015
Location: Australia
Posted: 18th Apr 2015 20:47
Glad it's of use Ace. Truth be told, most coders don't comment code much so when you see it, consider it as showing off
Development/ Gaming Rigs
Sys 1: i7-4770 (3.5)/16Gb/128 SSD/3Tb/970gtx/2 x 23, 1 x 27 LCD - Sys 2: i7/8Gb/670gtx/1.5Tb/1 x 23 LCD - Sys 3: Amd Quad/8Gb/645gtx/1Tb/30" LCD
PM
AuShadow
GameGuru TGC Backer
10
Years of Service
User Offline
Joined: 2nd Dec 2013
Location: Australia
Posted: 22nd Apr 2015 09:11
When you see it, consider it good guru practice for people learning,
PC Specs: Windows 7 home 64-bit, Amd 7900 3gb DDR5 graphics, 8gb DDR3 Ram, Intel i7 3.4ghz
Old Larry
GameGuru TGC Backer
12
Years of Service
User Offline
Joined: 26th Apr 2012
Location: Bucharest, Romania
Posted: 22nd Apr 2015 09:35
Brilliant, I've start to use it in any of my game scenario.
Many thanks, !nullptr !
Smile today, tomorrow could be worse

http://bestradiolarry.ro/fpsarea/

"The best forum, game software, operating system or web platform, it's that software which can give you most of the features and speed, not just amazing graphics."
perelect
9
Years of Service
User Offline
Joined: 27th Mar 2015
Location: Australia
Posted: 23rd Apr 2015 19:54
Thankyou for this script,
Well done, looks great and works great.
Thanks for all the comments in the script as well.
It makes reading and learning a lot easier.
I may be old, but at least my memory still ....hmmm

Pavilion dv6 Notebook, Intel(R) Core(TM) i5-2410M CPU @ 2.30 GHz, Win 7 64 bit, 4 GB Ram, Radeon (TM) HD 6490M, 2789 MB Memory. Resolution 1366x768, Intel(R) HD Graphics 3000.
lordjulian
10
Years of Service
User Offline
Joined: 10th Jan 2014
Location:
Posted: 1st May 2015 16:03
It would be good to have a compass or indicator that shows the distance and direction of the current objective.
Julian
PM
!nullptr
Forum Support
9
Years of Service
User Offline
Joined: 27th Mar 2015
Location: Australia
Posted: 1st May 2015 21:54
Quote: "It would be good to have a compass or indicator that shows the distance and direction of the current objective."

You would have to code that in because I would have no idea what that objective is.

I have been looking at scripting in where current and closest enemies are but without being able to address entities by name it's a PITA trying to come up with a simple plug-in form.
Development/ Gaming Rigs
Sys 1: i7-4770 (3.5)/16Gb/128 SSD/3Tb/970gtx/2 x 23, 1 x 27 LCD - Sys 2: i7/8Gb/670gtx/1.5Tb/1 x 23 LCD - Sys 3: Amd Quad/8Gb/645gtx/1Tb/30" LCD
PM
Kesstryl
8
Years of Service
User Offline
Joined: 29th Jul 2015
Playing:
Posted: 30th Jul 2015 09:42
I love this script! I had to read the comments to get it working. If you assign it to a rock or another scenery item, make sure to set Static Mode to No (default for a rock wall which is what I used is Yes) or it won't run. Once I figured that out in the awesome comments on the script, it works perfectly!
PM
Corno_1
GameGuru Tool Maker
13
Years of Service
User Offline
Joined: 3rd Nov 2010
Location:
Posted: 30th Jul 2015 12:58
Bug: You have 361 degree the 360 is shown as -0 Maybe you know this already, but I was not sure.

Fix:


Sorry for no comments

But besides that nice script
My dream is to develope games, which makes fun when I create it and fun when other people play it.
PM
smallg
Community Leader
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 30th Jul 2015 18:27
Quote: "I have been looking at scripting in where current and closest enemies are but without being able to address entities by name it's a PITA trying to come up with a simple plug-in form."


stock characters use ai_soldier_state[e] so you can always check for that rather than names
life\'s one big game

windows vista ultimate

i5 @3.3ghz, 4gb ram, geforce gtx460, directx 11
Corvus
8
Years of Service
User Offline
Joined: 27th Jul 2015
Location:
Posted: 30th Jul 2015 20:53
Any way to remove the bottom number and text "navigation compass"?
Inertia
8
Years of Service
User Offline
Joined: 12th Jul 2015
Location: SoCal, USA
Posted: 30th Jul 2015 22:41
Corvus wrote: "Any way to remove the bottom number and text "navigation compass"?"


Just comment out lines 78-80 so that it looks like the code snippet below:

Win7 x64 | i5 @3.3GHz | 4GB RAM | GTX580 1.5 GB
PM
Corvus
8
Years of Service
User Offline
Joined: 27th Jul 2015
Location:
Posted: 31st Jul 2015 00:21
Sorry, what lines am I deleting specifically?
Inertia
8
Years of Service
User Offline
Joined: 12th Jul 2015
Location: SoCal, USA
Posted: 31st Jul 2015 00:56
Look for these lines:

Panel(45,3,55,4)
TextCenterOnXColor(50,5,3,bearing,255,255,255)
TextCenterOnXColor(50,7,2,"Navigation Compass",155,155,155)

You can delete them or put double dashes in front of each line which will deactivate them.
Win7 x64 | i5 @3.3GHz | 4GB RAM | GTX580 1.5 GB
PM
Corvus
8
Years of Service
User Offline
Joined: 27th Jul 2015
Location:
Posted: 31st Jul 2015 01:33
Thanks. Got it working!
Jack T
GameGuru TGC Backer
9
Years of Service
User Offline
Joined: 27th Feb 2015
Location: Nowhere Land
Posted: 31st Jul 2015 09:53
Awesome, just awesome.
Why pick a side, if there's no good and bad...
PM
Peregrinus
8
Years of Service
User Offline
Joined: 27th Jun 2015
Location: MON
Posted: 31st Jul 2015 12:22
Very cool script ! I really appreciate all the commenting in the script like everyone else. It really helps when you are a beginner at lua script.
sularus oth mithas
PM

Login to post a reply

Server time is: 2024-05-08 20:16:09
Your offset time is: 2024-05-08 20:16:09