Scripts / How do i make a NPC Shoot a t a certain entity?

Author
Message
BrainyPlayz
8
Years of Service
User Offline
Joined: 9th Oct 2016
Location:
Posted: 12th Oct 2016 09:31
I was wondering if there was a script to make a Character shoot at a certain entity. The reason i need this (Continue reading if interested) is so that i can make a scene in my game where NPC's Are shooting at targets and it's gonna be a kind of tutorial thing.

Thanks For Help

-Aaron @BonfireStudiosABD
PM
smallg
Community Leader
19
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 12th Oct 2016 15:29
You have to fake it with PlaySound(e,1) and some animation set yourself - depends on the model as to which frames but its pretty small script.

If you need them to do damage then it can get a little more complicated but you will need to set the health of the target manually using SetEntityHealth(#,g_Entity[#]['health']-damage)... Still pretty simple if the characters don't change target as you will be working with entity numbers that dont change.

Pretty sure I have a script for this somewhere on the forums but if not I'll post one later.
lua guide for GG
https://steamcommunity.com/sharedfiles/filedetails/?id=398177770
windows 10
i5 @4ghz, 8gb ram, AMD R9 200 series , directx 11
Belidos
3D Media Maker
9
Years of Service
User Offline
Joined: 23rd Nov 2015
Playing: The Game
Posted: 12th Oct 2016 17:44
Yeah smallg you have a team AI script in your mega-thread, it's pretty awesome

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.
smallg
Community Leader
19
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 12th Oct 2016 19:02 Edited at: 12th Oct 2016 19:09
Quote: "Yeah smallg you have a team AI script in your mega-thread, it's pretty awesome "

i don't believe that's quite what the OP is looking for here, i think it's more like this

the script (attached) is designed to work with the models found here
https://forum.game-guru.com/thread/208967#msg2490363
but with a few changes it will work with the default soldiers (i don't know if the stock characters have a reload animation though).
p.s. change the HP/strength of the character(s) to adjust their firing delay if you want them to fire at different speeds like in the video.

also as you will likely be needing some targets for the player this might help get you started (very old script but should still work)
https://forum.game-guru.com/outbound?url=https%3A%2F%2Fforum.game-guru.com%2Fthread%2F207801%3Fpage%3D4%23msg2500003
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
Belidos
3D Media Maker
9
Years of Service
User Offline
Joined: 23rd Nov 2015
Playing: The Game
Posted: 12th Oct 2016 20:00
Ah I see, I've gotten used to the word character meaning non player characters, and player meaning the player character when talking about GameGuru.

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.

Login to post a reply

Server time is: 2024-12-22 22:29:41
Your offset time is: 2024-12-22 22:29:41