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 / Create new entity via script

Author
Message
Runihadacow
11
Years of Service
User Offline
Joined: 17th May 2012
Location:
Posted: 1st Jan 2014 05:44
is their a way to spawn or create an entity via a script. I would use the "If Used" action but its a store so that I must be able to spawn different items depending on the players action. I would like it best to spawn the item they are buying right behind them. If their is no way to do that any recommendations on how to make a store like script to buy weapons?
ncmako
12
Years of Service
User Offline
Joined: 19th Feb 2012
Location: Hendersonville,NC
Posted: 1st Jan 2014 17:34
Hi Runihadacow
In the syntax list there are two conditions called
"PLRFACING=X" and "PLRNOTFACING=X". One of these two should
help you. You can spawn the entities when the player is/is not
facing a certain direction.
best

You know you're a bad gamer when you're able to run out of infinite lives.
Runihadacow
11
Years of Service
User Offline
Joined: 17th May 2012
Location:
Posted: 12th Jan 2014 09:11
Im not sure I get it. How do I make somthing spawn elsewhere. That seems like just the code for facing.
BlackFox
FPSC Master
15
Years of Service
User Offline
Joined: 5th May 2008
Location: Knight to Queens Bishop 3
Posted: 12th Jan 2014 14:36 Edited at: 12th Jan 2014 14:36
I myself use "settargetname=x" and "activatetarget=1". For example, this is a snippet from a script I have in a game where the player interacts with a character. He is assigned a tommy gun and ammo (there is much more but this is just a snippet)...



I spawn the tommy gun and ammo using the commands "settargetname=x" and "activatetarget=1" and use these throughout the entire script spawning inventory and other items as requested by the player. I don't assign any special scripts other than the default or pickup scripts to the items, and I ensure the "spawn at start" is set to no. Using this method allows me more flexibility since the If Used field only allows for one item whereas I can spawn all the items I specify in one script (providing I have them placed in the level).

As far as having items spawn "behind" a player, you will need to ensure that the player when needed is "frozen" in place (plrfreeze=x). The spawning system is wacky in some degree and does not work as one would think it would, so you will need to be creative and work around the inherent issue.

There's no problem that can't be solved without applying a little scripting.

Login to post a reply

Server time is: 2024-03-29 05:55:09
Your offset time is: 2024-03-29 05:55:09