Files

> > CS2D > Lua Scripts > Starkkz's NPC Pack
Files overviewCS2D overviewLua Scripts overview

English Starkkz's NPC Pack >

66 comments3.64 mb, 1,163 Downloads

old Starkkz's NPC Pack

Starkkz
Moderator Off Offline

Hello, this is a pre-release of my NPC Pack for CS2D, I'm just uploading this as the thread seems that it's going to die and I don't know if someone will take this but I'm leaving it for you to use it.

> AI Features
• A* Pathfinding
• Angle calculation
• Distance calculation
• Target finding

> NPCs
• Strider
• HoundEye
• HeadCrab
• Alien Grunt
• Bullsquid



How to spawn a NPC?
You have to use the lua command SpawnNPC
In Lua has written
SpawnNPC('name of the NPC', x, y, rotation)

In console has written
lua "SpawnNPC('name of the NPC', x, y, rotation)"

NPC names has written
Strider
HoundEye
Headcrab
Agrunt


Probably I will keep adding NPCs to this pack, you can suggest more ideas at the thread thread cs2d NPC Pack: Ideas.

Credits to user useigor for some sprites.

IMG:https://i.creativecommons.org/l/by-nc-nd/3.0/88x31.png
edited 11×, last 29.08.15 12:06:05 am
Approved by Infinite Rain

Download Download

3.64 mb, 1,163 Downloads

Comments

66 comments
Page
To the start Previous 1 2 3 4 Next To the start

Log in!

You need to log in to be able to write comments!Log in

old

AlcatrazZ
BANNED Off Offline

Cool! I will use the script for my comming script.
Thanks.
I like it!

old

Dousea
User Off Offline

user Avo has written
Adding these custom NPCs would be nice to implement with entities in map editor. What I mean is to create NPC entity and if its name is something like "NPC:Strider", game will automatically spawn Strider on the map where that entity is put.

1
2
3
4
5
6
7
8
9
10
11
12
13
for key, self in pairs (entitylist ()) do
	if (entity (self.x, self.y, "typename") == "Env_NPC") then
		local name = entity (self.x, self.y, "name")
		
		if (name:sub (1, 4) == "NPC:") then
			local noerror, message = SpawnNPC (name:sub (5, #name), ((self.x * 32) + 16), ((self.y * 32) + 16), entity (self.x, self.y, "int0"))
			
			if (not noerror) then
				print ("NPC Error: " .. message)
			end
		end
	end
end
I like it!

old

Vennece
User Off Offline

thanks user Starkkz and i gonna make npc for me
I like it!

old

Starkkz
Moderator Off Offline

@user Dousea: It is, at least my script has a functionality that allows you to choose which tiles are going to be walkable, it also affects the pathfinding algorithm.

old

Dousea
User Off Offline

Impressive. I hope I can make my own NPC but because of the difficulty of your script makes it impossible. Well is it possible to make NPCs walk around walkable tiles? I hope it is.
I like it!

old

Starkkz
Moderator Off Offline

@user Vennece: Just place a trigger_if on the map and put the first example.

old

Vennece
User Off Offline

can i add in map editor? these npc please..
I like it!

old

Hellcat
GAME BANNED Off Offline

Awesome Starkkz! Good Job
I like it!

old

Avo
User Off Offline

Adding these custom NPCs would be nice to implement with entities in map editor. What I mean is to create NPC entity and if its name is something like "NPC:Strider", game will automatically spawn Strider on the map where that entity is put.
I like it!

old

Pseudon
User Off Offline

Masterpiece. This could be the start of so many maps,i mean with this script and if "we" the players could make our own NPCs then many users could make custom maps for singleplayer and co-op,and i think that it would be awesome.
I like it!

old

BATTLEKOT
User Off Offline

Stridrer!
Please create Hunter from HL2 ep2
I like it!

old

-DIE Wolf-
User Off Offline

I get glitch. When i spawn about 3 HeadCrab at same position. Try it, and u will see
Also, nice LUA.
I like it!

old

SovietComrade
User Off Offline

Can you make somethings about solder?
Like solder with sniper
____________ RPG
____________ shield
____________ shotgun

Can you?
I like it!

old O_o"

Lobwver
User Off Offline

OMG epic one
youre a genius
I like it!

old

Zero6
User Off Offline

Hahaha Starkkz, i remember in that 30 striders army they was too many and i murder them all! like a boss
I like it!

old

tonton2d
User Off Offline

awesome!
I like it!

old

theunrealone
User Off Offline

Lol, it is cool! But please make it that you can set it by using trigger function.
I like it!

old

Gajos
BANNED Off Offline

Add explosion while Strider die.
I like it!

old

Reaxter
User Off Offline

Impressive.
I like it!
To the start Previous 1 2 3 4 Next To the start