Product Chat / Viewrange

Author
Message
vrg
9
Years of Service
User Offline
Joined: 27th Aug 2014
Location: Netherlands
Posted: 9th Jul 2016 08:40 Edited at: 9th Jul 2016 08:42
Creating a testlevel with two enemies and both the same distance from the player. Both enemies are using ai_soldier.lua
as AI script. Strange, settings of viewrange 0 the enemies are reacting faster on distance then with higher viewrange settings.
So leaving the viewrange settings 0 is the best result
Belidos
3D Media Maker
8
Years of Service
User Offline
Joined: 23rd Nov 2015
Playing: The Game
Posted: 9th Jul 2016 18:48 Edited at: 9th Jul 2016 19:00
A setting of 0 basically removes the view range and takes the range from the script.

i5, NV960 2GB, 16GB memory, 2x 2TB Hybrid, Win10.
i3 , Intel integrated graphics, 6GB memory, 512GB Generic SATAIII Win8.1.
Intel Celeron (duel Core), Radeon integrated graphics, 4GB memory, 180gB Generic SATAII, WinVista.
Q6600, Intel integrated graphics, 8GB memory, 512GB Generic SATAII, Win7.
synchromesh
Forum Support
10
Years of Service
User Offline
Joined: 24th Jan 2014
Location:
Posted: 9th Jul 2016 18:56 Edited at: 9th Jul 2016 19:02
The view range is set in the script so you cannot increase it ..... But last time I tried you can go below the set range ..
Try this ..... place character ....select his properties.... set "View Range" to 200 and "View Cone Angle " to 1000

You should be able to creep right up to him before he detects you .... It worked great for infiltrating an area and not getting noticed if you hide around a corner
The only person ever to get all his work done by "Friday" was Robinson Crusoe..
PM
smallg
Community Leader
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 9th Jul 2016 21:09 Edited at: 9th Jul 2016 21:16
Quote: "View Cone Angle"

works like a circle around the player so 0 to 180 (half of 360 because it will calculate left and right from the centre point) with a low value meaning a narrow vision, 180 meaning circular vision (can see all around him, including behind)

Quote: "View Range"

setting from 1 to 1500 (is limited to a max of 1500 due to a hard coded value), anything lower = shorter vision. (0 will act like 1500)

if you want to see if an enemy can see you then you can use a little script like this (will display 1 if you can be seen, 0 if not)
lua guide for GG
https://steamcommunity.com/sharedfiles/filedetails/?id=398177770
windows 10
i5 @4ghz, 8gb ram, AMD R9 200 series , directx 11
vrg
9
Years of Service
User Offline
Joined: 27th Aug 2014
Location: Netherlands
Posted: 9th Jul 2016 22:24 Edited at: 9th Jul 2016 22:24
Thanks for the info, something to try out.
3com
10
Years of Service
User Offline
Joined: 18th May 2014
Location: Catalonia
Posted: 11th Jul 2016 17:20
I've notice in soldier.lua :



"AICouldSee" statement, not being declared in the script itself, neither in global.lua.

Someone know how it works, where is it declared?


As aside note, I remember something like "plrCanBeSeen" but I'm not able to find it, I should dream it.

3com
Laptop: Lenovo - Intel(R) Celeron(R) CPU 1005M @ 1.90GHz

OS: Windows 10 (64) - Ram: 4 gb - Hd: 283 gb - Video card: Intel(R) HD Graphics

PM
smallg
Community Leader
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 11th Jul 2016 17:32 Edited at: 11th Jul 2016 17:33
Quote: " if ( AICouldSee ( EntObjNo , ai_dest_x[e] , g_Entity[e]['y'] , ai_dest_z[e] ) == 0 )"

it's a raycast from the "EntObjNo" to the x,y,z (in this case, x = ai_dest_x[e] / y = g_Entity[e]['y'] / z = ai_dest_z[e])
only works for characters and simply returns if the object can see the target location (returns 1 if it can)
note; assumes 360 vision on the character.
lua guide for GG
https://steamcommunity.com/sharedfiles/filedetails/?id=398177770
windows 10
i5 @4ghz, 8gb ram, AMD R9 200 series , directx 11
3com
10
Years of Service
User Offline
Joined: 18th May 2014
Location: Catalonia
Posted: 11th Jul 2016 17:52
Thanks to clarify smallg.

What's about "plrCanBeSeen" statement, had I dreamed it?

3com
Laptop: Lenovo - Intel(R) Celeron(R) CPU 1005M @ 1.90GHz

OS: Windows 10 (64) - Ram: 4 gb - Hd: 283 gb - Video card: Intel(R) HD Graphics

PM
smallg
Community Leader
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 11th Jul 2016 18:02
use
g_Entity[e]['plrvisible']
or
GetEntityPlayerVisibility(e)

(returns 1 if character can see the player or 0 if not)

is that what you mean?
lua guide for GG
https://steamcommunity.com/sharedfiles/filedetails/?id=398177770
windows 10
i5 @4ghz, 8gb ram, AMD R9 200 series , directx 11
3com
10
Years of Service
User Offline
Joined: 18th May 2014
Location: Catalonia
Posted: 11th Jul 2016 18:14
I already know this.

But for some reason I thought I saw a resemblance to this command; but I think I'm wrong.
Anyway thanks again mate. so another for you. Many hot here now (summer season here).
my brain is boiling from the heat, so do not make me much attention.

3com
Laptop: Lenovo - Intel(R) Celeron(R) CPU 1005M @ 1.90GHz

OS: Windows 10 (64) - Ram: 4 gb - Hd: 283 gb - Video card: Intel(R) HD Graphics

PM

Login to post a reply

Server time is: 2024-06-29 02:46:04
Your offset time is: 2024-06-29 02:46:04