make x a player attribute:
in player.ini add:
[killedpawns]
initial=0
low=0
high=7
This adds a player attribute - a value that can be accessed by every script, must be a number, and is saved when you save the game. The value is auto-presetted to 0 (inital value).
And then in the death order of the pawns you use this attribute:
...
ModifyAttribute("killedpawns",1,"Player"); //Adds 1 to the killedpawns-attribute
if(GetAttribute("killedpawns","Player")=7) //if you have killed seven of them
{
SetEventState("ChangeLevel",true); //Set level-change-trigger on
SetAttribute("killedpawns",0,"Player"); //Set back attribute
}
...
Now you just have to make sure that the TriggerChange field of the ChangeLevel entity is set to the Trigger you set on (In this case "ChangeLevel")
Once you have killed seven of them, the level will change according to the ChangeLevel entity.
More information is in the docs under ChangeLevel entity and in the pawn scripting section.
This should help you.
EDIT: Oh sorry, i just saw that you wanted to show a text too. Well then this gets a bit more complicated.
Assuming that you use the code above, you must use a Message entity. I will not explain this entity too deeply here, search the docs for its usage. The trigger name of the message entity should be ChangeLevel, but the TriggerChange field of the ChangeLevel entity OT. Otherwise the message may not be displayed because the level ends before the message can be displayed....
For this, we need a system of LogicGates:
The first one is a LogicGate of the type 7 (HOLD). Trigger1Name should be our ChangeLevel and Delay is the number of seconds until the level change. Name it CLDelay
The second is a LogicGate of the type 4 (XOR, if the triggers are in different states return true). Trigger1Name is ChangeLevel and Trigger2Name CLDelay. The name is ChangeLevel2.
When the player has killed all the seven pawns, this will happen:
1. The Trigger ChangeLevel goes on. It stays on until the end of the level.
2. A Message is displayed on the screen
3. The first LogicGate CLDelay goes on and stays on for a specified number of seconds
4. The second LogicGate waits for the first to go off
5. When the first LogicGate goes off the level changes
You will then use the ChangeLevel2 trigger as a ChangeTrigger for you ChangeLevel entity...
That's it all. Hope this helps.
