Forum

> > CS2D > Scripts > How do you spawn an NPC on a specific tile#?
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch How do you spawn an NPC on a specific tile#?

8 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt How do you spawn an NPC on a specific tile#?

olivebates
User Off Offline

Zitieren
Hey there, new to lua here.

So, I want it so theres a zombie that spawns on a spcific tile# (i.e. tile 113) with 100 life.

These are the 3 things I need to know
How to edit a specific tile.
How to spawn an NPC at a specific position.
and How to set the life of that specific NPC.

EDIT: If you were wondering, I want to make my own wave mod.

alt Re: How do you spawn an NPC on a specific tile#?

Alistaire
User Off Offline

Zitieren
>_<

Tutorial: How to spawn an NPC

>Method 1#
- Make an Env_NPC
- Edit the settings; set the health to the health you want and the rotation to the rotation you want.
- Change the name to "Wave"
- Copy the entity to every tile you want it
- Place a trigger_start, triggering "Wave start"
- Place a trigger_delay with the ammount of seconds you want to let the NPC's spawn from start of round, and call it "Wave start". Make it trigger "Wave".
- Copy this entity to every tile you want an NPC to spawn in the wave.

alt Re: How do you spawn an NPC on a specific tile#?

olivebates
User Off Offline

Zitieren
Thats mighty nice and all, but I already know this. I want to be able to have a dynamic amount of different npcs I can spawn on the same block (both Vorginaughts and Zombies, headcrabs ect.)

And then I also want to make it so when all the NPCs are dead, then the next wave spawns.

Im gonna have it as an array for each wave, on what npcs to spawn.
1× editiert, zuletzt 06.08.11 21:55:10

alt Re: How do you spawn an NPC on a specific tile#?

Bowlinghead
User Off Offline

Zitieren
Its the lua-scripts section, idiot

How do you mean "How to edit a specific tile."?
The Tile psoition has a x- and a y- position.
In the map editor you can see it in the map editor.
Example:
12|52
12=x
52=y

If you need help you can look at the info.txt at first!
You can find the info.txt at "Counter Strike 2D/sys/lua/info.txt".
There are all addhooks with all possible parameters.

I cant help you with this question but I am 100% sure that it is possible what you want!

Edit:
Try it with "spawnnpc <type> <x> <y> <rot>".

alt Re: How do you spawn an NPC on a specific tile#?

Apache uwu
User Off Offline

Zitieren
I think it's by absolute location so you need to multiply the x&y by 32 so you can get the correct tile location.

ex. 12, 52

12*32=384
52*32=1664

Console:
1
spawnnpc 1 384 1664

Lua:
1
parse("spawnnpc 1 384 1664")
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht