English NPC Range and Weapon

4 replies
Goto Page
To the start Previous 1 Next To the start
02.01.18 07:06:59 pm
Up
CrazyPenguin
User
Offline Off
With trigger_if can I change NPC's range and weapon and how ?

I find their range quite short and they need a better weapon




EDIT

I should explore more before asking questions...anyway I found out the way to edit range I just edit the npc.lua file but still I don't know how to change the weapon

Is it also possible to not make them run towards you and just stay in place and shoot from distance ?

Here is the entire npc code
Spoiler >
edited 2×, last 02.01.18 08:07:51 pm
AFTERLIFE >>24/7<< Online Dedicated Zombie Server ~ Connect IP: 94.177.171.167
03.01.18 01:05:20 pm
Up
Pagyra
User
Offline Off
My CS2D standarд NPCs info:
IMG:http://unrealsoftware.de/u_scr/u87cd_4d93a32fs1.jpg?t=1435937120

--------
1 - Zombie (weapons id 249)
2 - Headcrab (weapons id 249)
3 - Snark (weapons id 249)
4 - Vortigaunt (weapons id 249)
5 - Soldier (weapons id 248)
Standart aim range is 11 tiles
All npc can be moved as images - use imagepos for move it, but there is some problem.

Hooks of attack for different NPCs

Zombie:
target~=0
countdown=-50
rotvar=40

Headcrab:
target~=0
countdown=-20
rotvar=20

Snark
target~=0
countdown=-15
rotvar=20

Vortigaunt
For melee attack
target~=0
countdown=-50
rotvar=40

For range attack
target~=0
countdown=-50
upgrade=40?
upgrade=1 - It see its target and charge blast
upgrade=0 - Attack moment

Soldier
countdown=7
target~=0

Returns a value of NPCs:

exists: boolean, 1(true) if object with this ID exists, 0(false) otherwise - if not exists.
typename: name of the type of this object
type: internal type ID of this NPC (1-5 meanings depending on type)
health: health value
mode: current mode (depending on type) - unknown
team: team of NPC
player: player - returns npc ID
x: current x position on map (in pixels)
y: current y position on map (in pixels)
rot: current rotation angle (in degrees)
tilex: current x position on map (in tiles)
tiley: current y position on map (in tiles)
countdown: countdown variable (cycle of countdown from values specifically for this NPC to 10) if -50 then attack moment
rootrot: original rotation(angle at spawn)
idle: idle value - unknown - sometimes this value changes when npc move
rotvar: rotation variable (this value changes in melee attack)
target: current target - returns player id (and 0 if there is no target)
upgrade: upgrade value (countdown between shots for NPC)
entity: boolean, true if object is spawned by entity, false otherwise if object is spawned by lua
entityx: x-coordinate (tile) of entity which spawned this object
entityy: y-coordinate (tile) of entity which spawned this object

Moreover there is:
object(0,"table"): a Lua table with all dynamic object IDs

Using the object table to list the IDs of all objects
local objectlist=object(0,"table")
for _,id in pairs(objectlist) do
print(id)
end
edited 2×, last 03.01.18 01:49:39 pm
03.01.18 01:40:59 pm
Up
Yates
Reviewer
Offline Off
Standard*
03.01.18 01:49:24 pm
Up
Pagyra
User
Offline Off
ok)
03.01.18 02:20:40 pm
Up
Yates
Reviewer
Offline Off
You should probably change that to something like "Thank you)))" before you get banned for a short post
To the start Previous 1 Next To the start