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 / Help With Variable

Author
Message
DoubleRThree
13
Years of Service
User Offline
Joined: 29th Sep 2011
Location: UK
Posted: 24th Dec 2011 09:39
Hey All,

I'm currently working on some scripts that will help create a game that is a mix of FEAR 3's "Contractions" mode and CoD's Nazi Zombies.

I have this script i'm working on (it's a modification of Bond1's "SlowZombie2Destroy")






I also have this line in the "SetupLevel.ini"



Most of the script is fine, except the Zombie still spawns when the variable is above 5.

Any thoughts or help would be appreciated.
TheDesertEagle
13
Years of Service
User Offline
Joined: 7th Jul 2011
Location: Canada - Who knows where else???
Posted: 24th Dec 2011 16:14
Try to seperate the spawn part to a start script

Joey-May god have mercy upon my enemies, because I won't.
Favourite Game-Call Of Duty MW2
gendestroier
14
Years of Service
User Offline
Joined: 5th Jun 2010
Location: Brazil
Posted: 24th Dec 2011 17:17
and also here...

Quote: ":state=11,varequal=killcount 5,spawnoff"


state=11 <-- condition
varequal <-- condition
spawnoff <-- "ACTION"

so here's the problem mate, spawnoff is an action, and since you had only conditions before that action, you have to use a ":" instead of a "," like this:



got it ?

mods for creating a inteligent game,at least
DoubleRThree
13
Years of Service
User Offline
Joined: 29th Sep 2011
Location: UK
Posted: 25th Dec 2011 09:43
Ah thank you for all the help!


Much Appreciated.
Captain Coder
FPSC Reloaded TGC Backer
13
Years of Service
User Offline
Joined: 6th Jul 2011
Playing: Elite: Dangerous
Posted: 26th Dec 2011 18:54
Does gendestroier's modification of the script work?

I would modify the destroy script to only add 1 to the "Kill Count" variable and then in the start script, check to see if the variable is greater than 5. If it is, then spawnoff, and destroy; like so:



I've never done this kind of script where it controls number of times something is spawned. Hope it works.

Captain Coder

As a believer in Jesus Christ, I am trying to use my passion for game creation for His glory.
angusm3
15
Years of Service
User Offline
Joined: 6th Mar 2009
Location: Right behind you...
Posted: 26th Dec 2011 20:44
using varequal can be unreliable because sometimes 2 things can happen at once and make the variable jump, so use vargreater and varless for things that are not cross level objective variables

I appear to have burst into flames...
DoubleRThree
13
Years of Service
User Offline
Joined: 29th Sep 2011
Location: UK
Posted: 27th Dec 2011 12:17
I've tested, and both ways work absolutely fine, except gendestroier's method tends to spawn one more, THEN stop. Captain Coder's version works perfectly.

@angusm3: Will bear that in mind, thank you.

Thanks Everyone.

Login to post a reply

Server time is: 2024-11-24 04:53:16
Your offset time is: 2024-11-24 04:53:16