Scripts / Free terrain map script

Author
Message
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 11th Sep 2016 21:30
As it is so quiet around here I thought I'd throw out something for people to play with.

Shift+E changes the range, just cycles around 5 different values by default.

Needs a 'bumpy' level as it displays the terrain height around the player, darker shade for lower areas, brighter for higher areas. Might not work with the 'frozen' build as it uses a lot of sprites.

'Enemies' show up as grey dots which change to red when alerted or attacking (uses the ai_soldier_state list so if you want non-soldier npcs to show up add "ai_soldier_state[e] = "patrol" or similar to their init script).

Have fun.
Been there, done that, got all the T-Shirts!

Attachments

Login to view attachments
PM
Pirate Myke
Forum Support
14
Years of Service
User Offline
Joined: 31st May 2010
Location: El Dorado, California
Posted: 12th Sep 2016 04:04
Nice. Thank you.
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, Screen resolution 1680 x 1050.

Freakon
GameGuru TGC Backer
15
Years of Service
User Offline
Joined: 24th Feb 2009
Location: UK
Posted: 12th Sep 2016 11:31
Looking good! The default radar is pretty nice, but a bit too generic, this adds a unique element for multi terrain levels

Thanks for sharing
ShN33Ky
Game Guru Backer
11
Years of Service
User Offline
Joined: 24th Mar 2013
Location: San Clemente ca.
Posted: 13th Sep 2016 02:37
Your terrain map is exactly what I'v been looking for....may I use it in my submarine game????.....Please???

....heare's a screen!!!
Processor: Intel(R) i7-4700MQ CPU @ 2.40GHz 2.40 GHz Installed memory (RAM): 16.0 GB (15.8 GB usable) System type: 64-bit Operating System,x64-based processor

Start the day by righting your wrongs then end you day right so you don't have to do it again tomorrow ...

sHn33Ky

Attachments

Login to view attachments
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 13th Sep 2016 19:59
Yep, that's the sort of use for it I had in mind, i.e. build it into a hud. If you throw the bezel into gimp you could recolour it to match the rest of the hud.

The script will work in pretty much any screen mode btw.
Been there, done that, got all the T-Shirts!
PM
ShN33Ky
Game Guru Backer
11
Years of Service
User Offline
Joined: 24th Mar 2013
Location: San Clemente ca.
Posted: 14th Sep 2016 15:41
thanks I will keep that in mind.....great work!
Processor: Intel(R) i7-4700MQ CPU @ 2.40GHz 2.40 GHz Installed memory (RAM): 16.0 GB (15.8 GB usable) System type: 64-bit Operating System,x64-based processor

Start the day by righting your wrongs then end you day right so you don't have to do it again tomorrow ...

sHn33Ky
gd
8
Years of Service
User Offline
Joined: 21st Jul 2016
Location: Small Darkroom with no red light
Posted: 14th Sep 2016 22:30
Hi @AmenMoses, thanks this is so cool.
Let us all know if your ever be able to include entities scenery too lol
Dark Base 900 Pro OJ: Rampage V Ed.10, i7 6950x non-OC, DDR4-3333 64 GB RAM, Win 10/64, Asus Strix GeForce 1080 x 2 MDA mode, Air cooled

Laptop - M17xR3
PM
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 16th Sep 2016 19:18 Edited at: 16th Sep 2016 19:19
Well it is doable, sort of.

Only dynamic entities are available to Lua scripts so it is a relatively simple matter to attach a script to all the entities that you want to appear and have the script add them to a searchable list, then when plotting the terrain the list could check to see if that particular x,z point is 'inside' any of the entities, if it is then the point could plot in a specific colour (or a colour determined from what the entity is, maybe from its name).

In order to do this you would have to create a list of all the entities you want to attach the script to and in the list have the length&width dimensions for the entity, then at runtime build a list of entities with any point within the display area with x,z points of the corners.

The math for all this would be quite a challenge as entity rotation must be taken into account.

As long as you didn't have thousands of entities it may be ok performance wise.

Static entities otoh are a different matter, unless someone can persuade Lee to provide access to them via Lua but that may be totally impossible for performance reasons, imagine painting plants and trees and boulders into a relatively 'empty' level, how is the engine to know which of these need to be 'visible' to Lua scripts?

-- Alternatively --

As the script stands it will display 'objectives', so you could put objective points around some entities which would show up as a dotted outline. You may need to edit the constant in the script that specifies the maximum number of objectives (f you make this constant too big you may run out of sprites btw) also you may want to change the objectives script to not delete them when you approach them.
Been there, done that, got all the T-Shirts!
PM
gd
8
Years of Service
User Offline
Joined: 21st Jul 2016
Location: Small Darkroom with no red light
Posted: 17th Sep 2016 12:13
Hi AmenMoses,
I see your point. Looks like to much work for anybody. Maybe a map PNG overlay on the radar compass would suit me best. Thanks again for you advice. I'm new to lua scripting, so taking it one step at a time and testing my code and yours lol.

Thanks gd Ed.
Dark Base 900 Pro OJ: Rampage V Ed.10, i7 6950x non-OC, DDR4-3333 64 GB RAM, Win 10/64, Asus Strix GeForce 1080 x 2 MDA mode, Air cooled

Laptop - M17xR3
PM
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 17th Sep 2016 12:41 Edited at: 17th Sep 2016 12:42
Another way of doing it would be to create sprites of the top down view of the entities that you want to show on the map then plot them on top on the terrain but below the bezel (the bezel would have to be big enough to cover the largest sprite).

An easier (and possibly cooler) way of doing it would be to have symbols plotted rather than images, like you have on OS maps for example to denote the presence of a church or post office.

I have a script that does a scrolling map but you need to make the map tiles yourself and it is quite a laborious process, plus the script hasn't been polished enough yet. I've created map tiles for the big escape level.

https://vimeo.com/175623167
Been there, done that, got all the T-Shirts!
PM
gd
8
Years of Service
User Offline
Joined: 21st Jul 2016
Location: Small Darkroom with no red light
Posted: 17th Sep 2016 12:54

Quote: "An easier (and possibly cooler) way of doing it would be to have symbols plotted rather than images, like you have on OS maps for example to denote the presence of a church or post office. - AmenMoses"


That's sounds cool, I like the idea of that. I know a map designer lol. As my project is set in the medieval time and they only really used outlines for their maps it would suit it very well.

Thanks
Dark Base 900 Pro OJ: Rampage V Ed.10, i7 6950x non-OC, DDR4-3333 64 GB RAM, Win 10/64, Asus Strix GeForce 1080 x 2 MDA mode, Air cooled

Laptop - M17xR3
PM
gd
8
Years of Service
User Offline
Joined: 21st Jul 2016
Location: Small Darkroom with no red light
Posted: 17th Sep 2016 12:57 Edited at: 17th Sep 2016 12:58
Hey AmenMoses, that vid is great. I see your hiding something from us all lol

Great work
Dark Base 900 Pro OJ: Rampage V Ed.10, i7 6950x non-OC, DDR4-3333 64 GB RAM, Win 10/64, Asus Strix GeForce 1080 x 2 MDA mode, Air cooled

Laptop - M17xR3
PM
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 17th Sep 2016 14:30
It's not a case of hiding anything, I have posted videos of all the cool stuff I'm working on, well almost all anyhow.

I just haven't got the time to polish it enough to put it on the store. I put my compasses on the store as a test and so far only 9 people have bought them so it's a lot of work for not a lot of recompense!

I started off playing around with sprites six months ago but now I'm more into scripts to manipulate 3D objects, figured that would be more useful to people..
Been there, done that, got all the T-Shirts!
PM
gd
8
Years of Service
User Offline
Joined: 21st Jul 2016
Location: Small Darkroom with no red light
Posted: 17th Sep 2016 19:17
Cool will have a look
Dark Base 900 Pro OJ: Rampage V Ed.10, i7 6950x non-OC, DDR4-3333 64 GB RAM, Win 10/64, Asus Strix GeForce 1080 x 2 MDA mode, Air cooled

Laptop - M17xR3
PM

Login to post a reply

Server time is: 2024-12-22 23:00:15
Your offset time is: 2024-12-22 23:00:15