Scripts / Script for multiple entities

Author
Message
Gtox
3D Media Maker
9
Years of Service
User Offline
Joined: 5th Jun 2014
Location: South Africa
Posted: 16th Oct 2014 06:51
I've created a basic script to get animated fish to swim around, but it only works with one fish due to variable conflict. I tried using local variables, as well as using tables, but I failed due to scripting ineptness. Any help getting the script to work would be appreciated.
Here is the script:

Avram
GameGuru TGC Backer
17
Years of Service
User Offline
Joined: 3rd Sep 2006
Location: Serbia
Posted: 16th Oct 2014 10:06 Edited at: 16th Oct 2014 10:09
Try this:





smallg
Community Leader
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 16th Oct 2014 11:08
i think
Quote: "local PlayerDist = PlayerDistance(e)"
should read
Quote: "local PlayerDist = GetPlayerDistance(e)"
but it's not being used anyway.

life's one big game

windows vista ultimate

i5 @3.3ghz, 4gb ram, geforce gtx460, directx 11
Gtox
3D Media Maker
9
Years of Service
User Offline
Joined: 5th Jun 2014
Location: South Africa
Posted: 16th Oct 2014 12:21
Thank you very much,Avram - that works perfectly (and thanks smallg for mentioning the PlayerDistance issue - local PlayerDist = PlayerDistance(e) brings up an error).
Avram
GameGuru TGC Backer
17
Years of Service
User Offline
Joined: 3rd Sep 2006
Location: Serbia
Posted: 16th Oct 2014 13:26 Edited at: 16th Oct 2014 13:28
Yes, it's GetPlayerDistance and It's added in V1.009 so it will not work in older versions. However, it's not used at all so you can remove whole player distance related code.

Login to post a reply

Server time is: 2024-05-02 12:06:48
Your offset time is: 2024-05-02 12:06:48