Scripts / [SOLVED] One script for multiple zombies

Author
Message
Mortt
8
Years of Service
User Offline
Joined: 16th May 2016
Location:
Posted: 18th Feb 2023 18:41
How can you assign entity number, as in (g_Entity[e]['obj']) to a script when the script is used by several zombies?
So that each zombie using the script has the unique object number that can then be worked on, adapted in the script.
For example. 5 zombies in script. Each zombie then goes to a specific location. The object number then allows for the scripting that controls the actions of each zombie in one script.
Any ideas would be very helpful.
(Custom) Intel i7 3.3 Mhz. 16 GB fast ram. EVGA Nvidia 1050 Ti 4GB. Dell US27 2560 x 1440. Dell 24 1920 x 1080. Awesome.
Next G. Card EVGA GeForce GTX 970 Superclocked ACX 2.0 Gaming 4GB GDDR5 PCIe3.0 Graphics Card.
Would Like EVGA NVIDIA GeForce GTX 1080 8GB GDDR5X PCIe3.0 Graphics Card

The author of this post has marked a post as an answer.

Go to answer
PM
smallg
Community Leader
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 19th Feb 2023 19:00
yes, arrays/lists are fine for keeping lists of objects.
you would probably want a more user friendly way to define how they are grouped though, i.e. if named "zombie1" do this, else if named "zombie2" do this else do this etc
lua guide for GG
https://steamcommunity.com/sharedfiles/filedetails/?id=398177770
windows 10
i5 @4ghz, 8gb ram, AMD R9 200 series , directx 11
Mortt
8
Years of Service
User Offline
Joined: 16th May 2016
Location:
Posted: 20th Feb 2023 14:05
Yes. Was thinking of naming the individual zombies. But using lists sounds like a good plan. I did have this.
EntID001, 2,3 and 4 defined as object number at start of script. The actual obj numbers being 70012, 70013, 70014, 70015.
if EntID001 == g_Entity[e]['obj'] then ResetPosition(e,ResPosX01,600,ResPosZ01) end
if EntID002== g_Entity[e]['obj'] then ResetPosition(e,ResPosX02,600,ResPosZ02) end
if EntID003 == g_Entity[e]['obj'] then ResetPosition(e,ResPosX03,600,ResPosZ03) end
if EntID004 == g_Entity[e]['obj'] then ResetPosition(e,ResPosX04,600,ResPosZ04) end
This worked yesterday then it doesn't today. For some strange reason.
(Custom) Intel i7 3.3 Mhz. 16 GB fast ram. EVGA Nvidia 1050 Ti 4GB. Dell US27 2560 x 1440. Dell 24 1920 x 1080. Awesome.
Next G. Card EVGA GeForce GTX 970 Superclocked ACX 2.0 Gaming 4GB GDDR5 PCIe3.0 Graphics Card.
Would Like EVGA NVIDIA GeForce GTX 1080 8GB GDDR5X PCIe3.0 Graphics Card
PM
3com
10
Years of Service
User Offline
Joined: 18th May 2014
Location: Catalonia
Posted: 20th Feb 2023 16:16 Edited at: 20th Feb 2023 16:16
This post has been marked by the post author as the answer.
Try this one
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

Attachments

Login to view attachments
PM
Mortt
8
Years of Service
User Offline
Joined: 16th May 2016
Location:
Posted: 26th Feb 2023 12:15
smallg and 3com.
That is cool. All works now. But animations are a bit of a sticky issue, but perhaps its just since the windows update.
Thanks guys.
(Custom) Intel i7 3.3 Mhz. 16 GB fast ram. EVGA Nvidia 1050 Ti 4GB. Dell US27 2560 x 1440. Dell 24 1920 x 1080. Awesome.
Next G. Card EVGA GeForce GTX 970 Superclocked ACX 2.0 Gaming 4GB GDDR5 PCIe3.0 Graphics Card.
Would Like EVGA NVIDIA GeForce GTX 1080 8GB GDDR5X PCIe3.0 Graphics Card
PM

Login to post a reply

Server time is: 2024-11-21 15:53:29
Your offset time is: 2024-11-21 15:53:29