Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

FPSC Classic Scripts / kill to win script??

Author
Message
djmaster
User Banned
Posted: 29th May 2008 20:20
i know first you will say search but i immediately need this,is there any script that when i kill all those characters that follow waypoints i win the level.can somebody please give me something like this?? and be aware that theres multiple characters i need to kill so how do i set that when i kill ALL its level complete?

Soldier of Fortune Episode 1
Plystire
21
Years of Service
User Offline
Joined: 18th Feb 2003
Location: Staring into the digital ether
Posted: 30th May 2008 05:44
Search. I bet you would have gotten an answer much faster if you did.

Answer:

Use Objectives on each of the entities that you need to kill. Give them all different objective numbers and that will require the player to kill all of them in order to finish the level.


The one and only,


djmaster
User Banned
Posted: 30th May 2008 11:59
what about if i set all the entities to one objective number so i have to kill them in any order?

Soldier of Fortune Episode 1
Conjured Entertainment
AGK Developer
19
Years of Service
User Offline
Joined: 12th Sep 2005
Location: Nirvana
Posted: 30th May 2008 17:50 Edited at: 30th May 2008 18:54
Quote: "what about if i set all the entities to one objective number so i have to kill them in any order?"

Then you would only have to kill any ONE of them to advance.

If you don't want to kill them in order, then use a global variable (v109) to count your kills by incrementing it in the enemy destroy script.
Then check the number after incrementing it, and teleport the player to a WinZone if it equals your desired number of kills.

Here is an example...



Just use this FPI script for your enemies' Destroy AI (all of the enemies) and place a Win Zone somewhere in your map.
You will also need 10 or more enemies to kill of course.
The easy way to set the scripts is to set the destroy script in one enemy, then place copies of him in the map.
This script is a usual 'leavecorpse' destroy script, but it also will counts the frag and teleports the player to the Win Zone with 10 frags.

You'll notice I use greater than 9 instead of equal to 10.
That is because I didn't want to get caught in an endless loop if it somehow skipped that condition while it equaled 10, or if another script incremented it to a value greater than 10.
Using less than and greater than is a better practice than using equals to for avoiding endless loops, or in this case; an endless level.
This also makes a good way to have certain characters as targets, since only the ones assigned this script will increment the count.

You could also easily create a renamed copy of this and then edit it to use global var 7 instead of 6.
Assign that to other characters and you can know count and punish them for cilvilian kills.
You would need to change the plrmoveto to something other than the WinZone, but an escapable jail cell would be appropriate.

I now have a use for global variables 6 & 7, thanks!

6) Enemy Frag Counter
7) Civilian Frag Counter

Have Fun!

Don't forget to visit Conjured Entertainment

Plystire
21
Years of Service
User Offline
Joined: 18th Feb 2003
Location: Staring into the digital ether
Posted: 30th May 2008 23:42
There is no order for objectives. Objectives are objectives and just like in any mission, if you can complete one of them before the other, all the better that you got it out of the way sooner.


Say you have 5 objectives, numbered 1-5.

You could complete them in ANY of these orders and they would still complete the level:

12345
54321
32415
21354
43521
51423

It doesn't matter. You can look at the list of numbers as a checklist. Whent he player finishes one, check it off the list. When ALL of the numbers used in the level have been checked off, then the level ends.


The one and only,


Conjured Entertainment
AGK Developer
19
Years of Service
User Offline
Joined: 12th Sep 2005
Location: Nirvana
Posted: 31st May 2008 05:47 Edited at: 31st May 2008 06:11
Quote: "There is no order for objectives."

Well, you were the one who said it.

Quote: "Give them all different objective numbers and that will require the player to kill all of them in order to finish the level."

That is where he got confused about them being in order.

I know there is no order but if each character had its own script using a different variable, then there could be.

Quote: "Say you have 5 objectives, numbered 1-5."

Yeah but he had asked what happens if he gave them all the same number.

"Then you would only have to kill any ONE of them to advance."

This is something he should really just play around with and see what happens instead of asking anyway.
I'm still gonna use this script and the modified one for civilian kills though because it is so simple.
Now with using these variables, not only can we know if an objective is complete, but how well.

Don't forget to visit Conjured Entertainment

djmaster
User Banned
Posted: 31st May 2008 12:00
i simply placed 3 characters and set them objectives from 1 to 3 then i killed them in any order and i won the game so actually i dont need any scripts,thanks anyways

Soldier of Fortune Episode 1
Plystire
21
Years of Service
User Offline
Joined: 18th Feb 2003
Location: Staring into the digital ether
Posted: 31st May 2008 12:08
Huh, I had not thought of someone taking it that way.

"In order" and "In order to <insert finite goal here>" are taken as different meanings where I live, so I never thought of that.
Usually when I'm wanting to get the opposite message across, I would say "In THAT order" or something similar.

W/e, glad you got it working, dj.


The one and only,


Conjured Entertainment
AGK Developer
19
Years of Service
User Offline
Joined: 12th Sep 2005
Location: Nirvana
Posted: 31st May 2008 15:41
Quote: "i simply placed 3 characters and set them objectives from 1 to 3 then i killed them in any order and i won the game so actually i dont need any scripts,thanks anyways"


Yeah, well that is fine with a preset number of enemies where the user has to kill ALL of them.
If you wanted the user to kill any 5 of 20 enemies, then the script will come in handy.
Sorry, it didn't help your situation, but I will leave it here for anyone else who might find it useful when searching.

Don't forget to visit Conjured Entertainment

Login to post a reply

Server time is: 2024-11-24 08:39:39
Your offset time is: 2024-11-24 08:39:39