Scripts / Hero style

Author
Message
Nerdbeard
7
Years of Service
User Offline
Joined: 27th Apr 2016
Location:
Posted: 27th Apr 2016 20:48
So I want to know it I can have the Enemies attack another NPC so I can save them from being killed. But on the flip side I don't need the helpless NPC to die or anything. and I don't need the enemy NPC to focus on the player at all I just need it to look like they are trying to kill people around a town so the player can save the day.

Can this be done and if so how hard is it to write myself?
PM
Belidos
3D Media Maker
8
Years of Service
User Offline
Joined: 23rd Nov 2015
Playing: The Game
Posted: 27th Apr 2016 22:42
https://forum.game-guru.com/thread/207801?page=5#msg2500805

i7, NV960 4GB, 16GB memory, 2x 4TB Hybrid, Win10.
i5 , AMD 6770 1GB, 8GB memory, 512GB Generic SATAIII + 2TB Seagate Baracuda SATAIII, Win7.
i3, Radeon integrated graphics, 4GB memory, 512gB Generic SATAII, Win8.1.
Q6600, Intel integrated graphics, 2GB memory, 180GB Generic SATAII, WinXP.
smallg
Community Leader
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 28th Apr 2016 00:19
i dont think that is quite what he's aiming for, more like enemies attacking civilians... this is possible but you will need some basic functions that aren't available in the default code - i have some simple extra functions you can use though (such as rotate 1 object to face another) at the top of this post https://forum.game-guru.com/thread/207801?page=1#msg2479478

if you can code then the basic idea should be pretty simple to get into action, if you can't code then obviously it will be a lot harder

i would likely set the civilians to a waypoint (waypoint code looks like this)


(you will also need to add a variable in the civilian script to store that it is infact a civilian)

then in the enemy script set the enemies to find a civilian - this can be done with a 'for' loop and a GetDistance(e,#) check (function found in link) to check which civilian is closest
something like

then you can use the "target[e]" to head to the civilian like


obviously you will need more than just that but that is the basic script(s) flow.
lua guide for GG
https://steamcommunity.com/sharedfiles/filedetails/?id=398177770
windows 10
i5 @4ghz, 8gb ram, AMD R9 200 series , directx 11

Login to post a reply

Server time is: 2024-04-27 12:17:50
Your offset time is: 2024-04-27 12:17:50