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 / Spawning/Trigger problems

Author
Message
Da Doom Guy
17
Years of Service
User Offline
Joined: 8th Sep 2007
Location: My TARDIS
Posted: 28th Oct 2011 00:57
Ok, so I tried making a character spawn on a timer and also a weapon, but neither of them would spawn, so I tried using Trigger's, I got the weapon spawning but not the character(I even named him Nazi for easy reference for the trigger use) but he still didn't spawn, and idea what I'm doing wrong?

They are my Space Marines, and they shall know no fear.
BlackFox
FPSC Master
16
Years of Service
User Offline
Joined: 5th May 2008
Location: Knight to Queens Bishop 3
Posted: 28th Oct 2011 01:36 Edited at: 28th Oct 2011 01:38
Normally I spawn the character using a trigger- place the name of the character in the IfUsed field and set the character "spawn at start" property to No, and set the trigger's main script to "plrinzoneactivateused.fpi" (I use my own specific script, but that would be the default script to use). To have the character spawn a weapon, I can put the name of the weapon in the IfUsed field of the character and then edit the character's main script to have the "activateifused=1" in the script to activate the weapon.

There are many ways to do this, once you have a good understanding of the script language and conditions:actions. For example, I can script the trigger to spawn the character, and then script the character to spawn a multitude of things. I can make it as simple or complex as I need to.


Twitter: @NFoxMedia
Da Doom Guy
17
Years of Service
User Offline
Joined: 8th Sep 2007
Location: My TARDIS
Posted: 28th Oct 2011 02:08
I just wanted the Nazi soldier to spawn once I stepped into the trigger, the weapon(fists) I got to spawn, but the Soldier himself, won't spawn... I thought the script that it started with was it? guess I was wrong.

They are my Space Marines, and they shall know no fear.
BlackFox
FPSC Master
16
Years of Service
User Offline
Joined: 5th May 2008
Location: Knight to Queens Bishop 3
Posted: 28th Oct 2011 05:59 Edited at: 28th Oct 2011 06:01
Another trick when scripting is that you can set a weapon in the map, set the "spawn at start" field to no, and repeat for other weapons you may want. Then in another script (for example attached to the character main ai script) it will control the spawning of each weapon. This is performed by using the "settargetname=nameofweapon" and then using the "activatetarget=1" which works the same as the "activateifused=1" and having the name in the IfUsed field. This would then eliminate the need of a trigger, since one script attached to a character deals with it all. For example, I have a demo level for our WW2 game we made and one character spawns each weapon the player will need. Each weapon spawns one at a time, the player takes it, and then the character spawn the next (including ammo). We have a total of 5 items spawning, all done by one script and one character.

There is a large amount of script examples in the community guides that are a big help. Other documents we make reference to all the time for commands and such are attached to this post (download).


Twitter: @NFoxMedia

Attachments

Login to view attachments
maho76
13
Years of Service
User Offline
Joined: 31st May 2011
Location: universe-hub, playing the flute
Posted: 28th Oct 2011 11:11
try the appear2.fpi -script as the appearscript for the character. better to use this when triggered via zone. it should work then.
you can get problems when using the standard appear1.fpi.
Da Doom Guy
17
Years of Service
User Offline
Joined: 8th Sep 2007
Location: My TARDIS
Posted: 28th Oct 2011 19:15 Edited at: 28th Oct 2011 19:19
I have the Germans spawning now with the first suggestion to use:"plrinzoneactivateused.fpi" worked fine, infact all the trigger's in my level use that, once you leave the bunker, an alarm sounds and German guards spawn all around the outside of the building.

I also have a friend who suggested one of the Germans "trip" when you sock the other guard one, the only way I know how to do that is to kill him right when he spawns...


Also, I justl ooked for tripping, no results, but I did notice that a player begins the next level with all his weapons, it's not a bad thing, but, I had the player get "captured" in one of the levels, I'd need him ot lose all his weapons, and have to work with German weapons once he breaks out.






thanks for all your help.

They are my Space Marines, and they shall know no fear.
bruce3371
14
Years of Service
User Offline
Joined: 4th Aug 2010
Location: Englishland
Posted: 28th Oct 2011 19:30
To have the player lose his weapons, use a trigger zone that uses a script with the 'resetplrweapons' command.



Da Doom Guy
17
Years of Service
User Offline
Joined: 8th Sep 2007
Location: My TARDIS
Posted: 28th Oct 2011 20:47 Edited at: 28th Oct 2011 21:36
Would this maybe save over from level to level? I'm only working on a beta now, 3 levels come out for beta, out of 15 or so.

or, could I start the player out in it so once he spanws it removes his previous weapons? like hav thep layer start zone literaly inside ontop of the trigger area.



I'm actually trying to figure out Scripting, the manual isn;t being too helpful and the wiki doesn't know anything.

They are my Space Marines, and they shall know no fear.
bruce3371
14
Years of Service
User Offline
Joined: 4th Aug 2010
Location: Englishland
Posted: 29th Oct 2011 00:10
I'm using this method for my game. So, at the end of the training level, the player has his training weapons stripped from him, so in the next level, he has to start from scratch.

In other words, yes, it does carry over to the next level.

The only problem I've found with this method, is that I wanted the player to start the game proper (ie the levels after the training level) with a pistol, but, even though I assigned a weapon in the player start marker, the weapon strip script from the previous level over-rode this. So I had to have the pistol as a pick up, right at the player's feet when he spawns at the start marker.

Da Doom Guy
17
Years of Service
User Offline
Joined: 8th Sep 2007
Location: My TARDIS
Posted: 30th Oct 2011 06:10
How od I make a Script? the manual wasn't too helpful... when I did what it said to do, it kept keeping it as a .txt instead of converting to .fpi ...

They are my Space Marines, and they shall know no fear.
BlackFox
FPSC Master
16
Years of Service
User Offline
Joined: 5th May 2008
Location: Knight to Queens Bishop 3
Posted: 30th Oct 2011 06:22
Quote: "How od I make a Script? the manual wasn't too helpful... when I did what it said to do, it kept keeping it as a .txt instead of converting to .fpi ..."


You can do one of two things...

1. Use notepad, make your script, then save as, in the file name put in "name.fpi" (minus the quotes and name is what you want to call it), then save. It may put a ".txt" at the end of what you named it, and if so just remove the ".txt".

2. Use a program developed by Flatlander called FPI EditPad. It is very good for those learning how to script (thread is here.)


Twitter: @NFoxMedia

Login to post a reply

Server time is: 2024-11-24 05:10:05
Your offset time is: 2024-11-24 05:10:05