Scripts / How to keep shark in tank. ?

Author
Message
PCS
8
Years of Service
User Offline
Joined: 7th Jul 2016
Playing:
Posted: 10th Mar 2019 15:50
Hi all,
Please help me if possible,
I have this tank in this picture with Gtox white shark and the script that goes with it, but the shark swims out of the tank, thru the walls , would it be possible to keep it swimming inside the tank.
i try to put way points but that do not work, also a floor zone does not work.
Any advice or help please, i am clueless.


Pcs.
Windows 7 Professional 64-bit
Intel(R) Pentium(R) CPU G3260 @ 3.30GHz (2 CPUs), ~3.3GHz RAM 16GB NVIDIA GeForce GT 730
DirectX Version: DirectX 11

Attachments

Login to view attachments
Wolf
Forum Support
17
Years of Service
User Offline
Joined: 8th Nov 2007
Location: Luxemburg
Posted: 10th Mar 2019 15:57
The easiest way would be to give him an idle animation that has him swim within the confines of the tank.
PCS
8
Years of Service
User Offline
Joined: 7th Jul 2016
Playing:
Posted: 10th Mar 2019 16:25
This is the script for the shark.
Windows 7 Professional 64-bit
Intel(R) Pentium(R) CPU G3260 @ 3.30GHz (2 CPUs), ~3.3GHz RAM 16GB NVIDIA GeForce GT 730
DirectX Version: DirectX 11

Attachments

Login to view attachments
PCS
8
Years of Service
User Offline
Joined: 7th Jul 2016
Playing:
Posted: 10th Mar 2019 16:33
Ok i see there is no path specified in the script so maybe i must add the part for the soldier path , then maybe it would follow a path.
Don't know it that would work.
Windows 7 Professional 64-bit
Intel(R) Pentium(R) CPU G3260 @ 3.30GHz (2 CPUs), ~3.3GHz RAM 16GB NVIDIA GeForce GT 730
DirectX Version: DirectX 11
Wolf
Forum Support
17
Years of Service
User Offline
Joined: 8th Nov 2007
Location: Luxemburg
Posted: 10th Mar 2019 16:44
Is it necessary that the shark attacks the player?
PCS
8
Years of Service
User Offline
Joined: 7th Jul 2016
Playing:
Posted: 10th Mar 2019 17:02
no not while he is in the tank.
Windows 7 Professional 64-bit
Intel(R) Pentium(R) CPU G3260 @ 3.30GHz (2 CPUs), ~3.3GHz RAM 16GB NVIDIA GeForce GT 730
DirectX Version: DirectX 11
3com
10
Years of Service
User Offline
Joined: 18th May 2014
Location: Catalonia
Posted: 10th Mar 2019 19:57

Had you tried to talk with him?

Try this script. it works for me.





hth
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
cpu mark: 10396.6
2d graphics mark: 947.9
3d graphics mark: 8310.9
memory mark 2584.8
Disk mark: 1146.3
Passmark rating: 3662.4

PM
PCS
8
Years of Service
User Offline
Joined: 7th Jul 2016
Playing:
Posted: 10th Mar 2019 22:23
3com, thanks for the script, but it does exactly the same as the one i have , when i turn collision on, shark bump in to the walls.
Windows 7 Professional 64-bit
Intel(R) Pentium(R) CPU G3260 @ 3.30GHz (2 CPUs), ~3.3GHz RAM 16GB NVIDIA GeForce GT 730
DirectX Version: DirectX 11
smallg
Community Leader
19
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 11th Mar 2019 08:45
Add waypoints or raycasting to the script.

Raycasting would be more unique - raycasting in front of shark, if it hits something then change direction.

but if it doesn't matter for detail then waypoints are fine - doesn't need to be the GG path system, just place some objects in the tank and make the shark move to a random one each time he gets close to his current target.

Of course you can use the GG path system too, this is more linear though but gives an expected and more controlled outcome.
lua guide for GG
https://steamcommunity.com/sharedfiles/filedetails/?id=398177770
windows 10
i5 @4ghz, 8gb ram, AMD R9 200 series , directx 11
PCS
8
Years of Service
User Offline
Joined: 7th Jul 2016
Playing:
Posted: 11th Mar 2019 11:13
Thanks Smallg. Will give it a go.
Windows 7 Professional 64-bit
Intel(R) Pentium(R) CPU G3260 @ 3.30GHz (2 CPUs), ~3.3GHz RAM 16GB NVIDIA GeForce GT 730
DirectX Version: DirectX 11
smallg
Community Leader
19
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 11th Mar 2019 14:33
here's a version of the random waypoints method you can use.
place waypoints with waypoint.lua as static = no, isimobile = yes, name = (same as shark, i.e. shark1)
place a shark with shark_swimming.lua (or whatever you want to follow the waypoints), static = no, name = (same as waypoints to follow)
(see the included map file for example set up.

the reason for the names is so you can have multiple sets of waypoints so each shark can work easily without needing to edit or duplicate the scripts and they will only follow their own points as seen in the video
lua guide for GG
https://steamcommunity.com/sharedfiles/filedetails/?id=398177770
windows 10
i5 @4ghz, 8gb ram, AMD R9 200 series , directx 11

Attachments

Login to view attachments
PCS
8
Years of Service
User Offline
Joined: 7th Jul 2016
Playing:
Posted: 11th Mar 2019 17:46 Edited at: 11th Mar 2019 17:49
thank you Smallg
wow this loos fantastic.
Many thanks.
Windows 7 Professional 64-bit
Intel(R) Pentium(R) CPU G3260 @ 3.30GHz (2 CPUs), ~3.3GHz RAM 16GB NVIDIA GeForce GT 730
DirectX Version: DirectX 11
PCS
8
Years of Service
User Offline
Joined: 7th Jul 2016
Playing:
Posted: 11th Mar 2019 18:53
Smallg i have tested your scripts and it works 100%.
Windows 7 Professional 64-bit
Intel(R) Pentium(R) CPU G3260 @ 3.30GHz (2 CPUs), ~3.3GHz RAM 16GB NVIDIA GeForce GT 730
DirectX Version: DirectX 11
3com
10
Years of Service
User Offline
Joined: 18th May 2014
Location: Catalonia
Posted: 11th Mar 2019 19:03
Place waypoints and add civilian_waypoint.lua to the shark, it works for me. Add the script as is, and try.



Nice vid smallg.



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
cpu mark: 10396.6
2d graphics mark: 947.9
3d graphics mark: 8310.9
memory mark 2584.8
Disk mark: 1146.3
Passmark rating: 3662.4

PM
PCS
8
Years of Service
User Offline
Joined: 7th Jul 2016
Playing:
Posted: 11th Mar 2019 19:16 Edited at: 11th Mar 2019 19:20
3com, nice bubbles, how did you make the bubbles.
i dont have the civilian_waypoint.lua script.
Windows 7 Professional 64-bit
Intel(R) Pentium(R) CPU G3260 @ 3.30GHz (2 CPUs), ~3.3GHz RAM 16GB NVIDIA GeForce GT 730
DirectX Version: DirectX 11
3com
10
Years of Service
User Offline
Joined: 18th May 2014
Location: Catalonia
Posted: 11th Mar 2019 19:46 Edited at: 11th Mar 2019 19:48


Can remember who has posted this script in the forum, anyway ty for sharing it.
And thanks to Gtox for their awesome white shark.

About bubles, with AM's sparks1_emitter.lua file.

hth
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
cpu mark: 10396.6
2d graphics mark: 947.9
3d graphics mark: 8310.9
memory mark 2584.8
Disk mark: 1146.3
Passmark rating: 3662.4

PM
smallg
Community Leader
19
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 11th Mar 2019 19:49
GG waypoint is flat though right? cos they're designed to follow the terrain, i think i'd prefer the fish to swim up and down like my version.
if you want to edit mine to follow a set path rather than random you can replace the part where it gets a random point with some code to loop the waypoints in order (look in the stock AI pathing code for an example but it's pretty simple, just + / - 1 til you reach max / 1).
lua guide for GG
https://steamcommunity.com/sharedfiles/filedetails/?id=398177770
windows 10
i5 @4ghz, 8gb ram, AMD R9 200 series , directx 11
PCS
8
Years of Service
User Offline
Joined: 7th Jul 2016
Playing:
Posted: 11th Mar 2019 20:07
Smallg i like the random way points, it looks better for me , like the shark decide almost for himself were he is going to swim. lol
Windows 7 Professional 64-bit
Intel(R) Pentium(R) CPU G3260 @ 3.30GHz (2 CPUs), ~3.3GHz RAM 16GB NVIDIA GeForce GT 730
DirectX Version: DirectX 11
3com
10
Years of Service
User Offline
Joined: 18th May 2014
Location: Catalonia
Posted: 11th Mar 2019 20:29
I'd prefer the white shark inside the pool. LOL
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
cpu mark: 10396.6
2d graphics mark: 947.9
3d graphics mark: 8310.9
memory mark 2584.8
Disk mark: 1146.3
Passmark rating: 3662.4

PM
Gtox
3D Media Maker
10
Years of Service
User Offline
Joined: 5th Jun 2014
Location: South Africa
Posted: 22nd Mar 2019 04:42
I made a few adjustments to the script, so the range[e] value actually means something now Set to 200, it keeps the shark in a smallish area, but you can just fiddle with it until it matches the size of the pool.
i3 8350k 3GB GTX1060 8GB RAM Windows 10

Attachments

Login to view attachments
PCS
8
Years of Service
User Offline
Joined: 7th Jul 2016
Playing:
Posted: 22nd Mar 2019 13:37
Thank you my friend.
Windows 7 Professional 64-bit
Intel(R) Pentium(R) CPU G3260 @ 3.30GHz (2 CPUs), ~3.3GHz RAM 16GB NVIDIA GeForce GT 730
DirectX Version: DirectX 11

Login to post a reply

Server time is: 2024-12-22 14:14:24
Your offset time is: 2024-12-22 14:14:24