Forum

> > CS2D > General > Npc-Trigger
Forums overviewCS2D overviewGeneral overviewLog in to reply

English Npc-Trigger

13 replies
To the start Previous 1 Next To the start

old Npc-Trigger

Jaso
BANNED Off Offline

Quote
How i do this for more npc,s because when i put it and there are 2 npc,s it works for both and that is what i dont want i want that its only for one npcs so every npcs has gotten his own script.
So not all the npc do the same trigger.

Is this possible DC or anyone?

old Re: Npc-Trigger

DC
Admin Off Offline

Quote
I don't understand what you want to do.

Quote
How i do this for more npc,s

do WHAT?

Quote
because when i put it and there are 2 npc,s it works for both and that is what i dont want

when you put WHAT?

and what script are you talking about?

if you are talking about triggering env_npc entities: give every entitiy a different name. this way you can trigger the one you want to trigger without triggering the other ones...

old Re: Npc-Trigger

SANTER
User Off Offline

Quote
i do that with paint

start trigger A delay
A delay trigger B delay
B delay trigger A delay, NCP ncp

its a science

old Re: Npc-Trigger

Jaso
BANNED Off Offline

Quote
No all wrong ok i try to explain again.
I have gotten a script which does the following thing when you kill a npc it does a trigger but now the problem appears when you put MORE npc,s then it doesnt matter which one you kill because they all do the same trigger.
Understand now?

Sorry for my bad english its not so well....
So can anyone find a solution for this?

old Re: Npc-Trigger

FASTDIE
User Off Offline

Quote
he want to make script or wants script
when npc will die next will be spawn at npc spawn point

old Re: Npc-Trigger

Jaso
BANNED Off Offline

Quote
No -.- i want if a npc dies that he does a TRIGGER!
but if i put 2 NPC,S and i kill them them BOTCH THEY DO THE SAME TRIGGER AND I JUST WANT THAT ONE NPC HAS HIS OWN TRIGGER GOT IT?

old Re: Npc-Trigger

K-tronic
User Off Offline

Quote
As far as I understood, your problem is, that the names of all npcs you use are the same. so give every npc it's own name and make triggers to every single.
(I hope that was right now - that's what I understood.)

old Re: Npc-Trigger

DC
Admin Off Offline

Quote
okay.. so.. simply check attributes of the NPC to distinguish?!
see sys/lua/info.txt and take a look at the object command.

the NPC type (zombie, headcrab or snark) is saved in the object(id,"player") value.

moreover you could check the position or whatever you want. it's kinda obvious...

if you want to check which entity spawned your NPC: this is much harder. you would have to keep track of this yourself with additional variables etc.

old Re: Npc-Trigger

Jaso
BANNED Off Offline

Quote
K-tronic,
You are right but the problem is i dont know how to do this so i need a kind of script i have already one for npc,s but this one just works for all npc,s please take a look at this script:

addhook("objectkill","_objectkill")
function _objectkill(id,pl)--Object ID, player id
if object(id,"type") == 30 then --If npc
parse("trigger test")
          
end
end

Maybe if some one could edit this script so it works for only one npc and not for every npc

pickachu,
npcs (CAN) activate a trigger try this script and you see that it works!

old Re: Npc-Trigger

DC
Admin Off Offline

Quote
only for one NPC. okay - but for WHICH one?

only the first one so it triggers only once? use a trigger_once or a Lua variable + condition

old closed Re: Npc-Trigger

Jaso
BANNED Off Offline

Quote
My objective is to create a kind of round system so how higher the round the more zombies there are so if you have killed all zombies a new round start.

If you still dont know what i mean go to youtube and type in nazi zombies to get the idea

I hope you got enough information about this and i hope somebady could make this because i am very bad at lua.
edited 1×, last 03.09.10 07:34:53 pm

Admin/mod comment

don't edit your post to push it! it's forbidden! /DC
To the start Previous 1 Next To the start
Log in to replyGeneral overviewCS2D overviewForums overview