Monster

Get Help on scripting in POL with configurations, config setups, script trouble shooting, etc.
Post Reply
Tharon
Novice Poster
Posts: 44
Joined: Fri May 15, 2009 2:27 am

Monster

Post by Tharon »

Hallo,

I want to create a monstergroup and if all monster auf this group are killed, it should create a new monstergroup.
Sorry for my bad english. I hope you can help me.

Also ich möchte eine Monstergruppe createn und wenn alle Monster dieser Gruppe getötet wurden, soll das script eine weitere Gruppe erstellen. Ich hab es versucht aber kriege das nicht hin, habe auch keine Beispielscripte :( .
Ich hoffe ihr könnt mir helfen.

Bitte nicht auslachen das war mein versuch:

Code: Select all

program test(who)


var i;
var x;
var y;
var array1 := {};

for ( x := -2; x <= 1; x := x + 1)
for ( y := -1; y <= 2; y := y + 2)
array1.append ( CreateNpcFromTemplate ( "Zombie", who.x+x, who.y-y, who.z ));

for (i:=0; i < array1.size(); i:=i+1)
if ("life" < 0)
CreateNpcFromTemplate ( "mummy", who.x+x, who.y-y, who.z );
endif

endfor
endfor
endfor

endptogram
Tomi
POL Developer
Posts: 478
Joined: Tue Feb 21, 2006 5:08 pm

Re: Monster

Post by Tomi »

First you need to have a script which creates this monster group and stores the serials of the npc's somewhere.

then you need to add the checks in death.src in scripts/misc when the monster dies and if necessary launch the group creating script from there again.
Tharon
Novice Poster
Posts: 44
Joined: Fri May 15, 2009 2:27 am

Re: Monster

Post by Tharon »

I create the group with:

for ( x := -2; x <= 1; x := x + 1)
for ( y := -1; y <= 2; y := y + 2)
CreateNpcFromTemplate ( "Zombie", who.x+x, who.y-y, who.z )
endfor
endfor

can you give me an example?
Post Reply