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 / Script commands NOT listed in the manual

Author
Message
Plystire
21
Years of Service
User Offline
Joined: 18th Feb 2003
Location: Staring into the digital ether
Posted: 6th Oct 2007 10:59
Okay, I'm hoping people can help me out with this one, as I believe it will prove very useful for ALL FPSC scripters out there.

This is for commands that exist within the "as-is" engine, not a re-compiled version of the FPSC-Game.exe. (such as empty's mod)

It would be very helpful if, instead of just saying that the command exists, we give a small description of what it does and/or how to use it.

I'll start off with these:

Conditions

Command: plrcanbeseen = X
Description: returns TRUE, if the player can be seen by the entity, where "=X" will provide additional vertical angle of sight data. If no "=X" is used, the default value is "=22".

Actions

Command: plrsound = X
Description: plays a 3d sound at the player's current position, the sound file is specified by "=X"

Command: sound = X
Description: plays a 3d sound at the entity's current position, the sound file is specified by "=X"

NOTE: According to the manual, the two commands should be "Sound" and "3DSound", but upon taking a closer look, the commands are really the two mentioned above. I tried to use "3DSound" and nothing would happen.

Command: stopsound
Description: Stops playing the currently looping sound.



If anyone has seen other commands that come with the default game engine, please list them here. I would like to help scripters out there by providing a nice reference of commands that are not in the manual or commands that are listed incorrectly in the manual.


The one and only,
~PlystirE~

In Soviet Russia, road forks you!

Mom: I may not be the alpha and omega, but I can sure as hell be yours!
Butter fingers
18
Years of Service
User Offline
Joined: 20th Mar 2006
Location: Mecca
Posted: 6th Oct 2007 18:07
PLRDROP : Has no effect.

Airslide
20
Years of Service
User Offline
Joined: 18th Oct 2004
Location: California
Posted: 7th Oct 2007 07:39 Edited at: 7th Oct 2007 07:41
Quote: "PLRDROP : Has no effect."


AH! But it does! It just doesn't like to work efficiently There's a thread around here where I expiremented, but couldn't come up with anything really useful because even though it would take a weapon from you and presumably a key, it would not free up the weapon slot, so it wouldn't let you have any extra guns It's not efficient for stripping the player of his weapons either because if for some reason he doesn't have it he'll actually get it rather than lose it.

EDIT:
Quote: "where "=X" will provide additional vertical angle of sight data. If no "=X" is used, the default value is "=22"."


Whoa, even I didn't know that. I always thought that was a redundant parameter in the default shoot script. That an Merrvaro told me that the parameter was useless and I should remove it from my script (that was a long, long time ago...).


Vote today and play the games!
Plystire
21
Years of Service
User Offline
Joined: 18th Feb 2003
Location: Staring into the digital ether
Posted: 7th Oct 2007 08:28 Edited at: 7th Oct 2007 08:31
Thanks, Butter Fingers. I don't believe that it has "no effect", but there do seem to be some problems with it according to others. I myself haven't given it a try, but the source does have some code behind the command dealing with removal of items from the inventory.

This is what I have gathered from looking into the source. This command is directly tied to the entity that the script belongs to. So for this to work it MUST be called FROM the script of the item you wish to drop. This command does not accept "=X" values.

This may or may not work, as I was not aware that item scripts still ran from inside your inventory.

[EDIT]
I believe it very important to note that the engine DOES NOT USE "PLRDROP" OR "PLRTAKE", the engine recognises "PLAYERDROP" and "PLAYERTAKE". The word "player" must be spelled out for the commands to be recognised.

That was from the source released for v1.0, I am not sure about later versions, it may have been fixed for them.
[/EDIT]

@Airslide, I believe the reason PLRDROP doesn't work very well, is because when the inventory item is dropped, it gets dropped at the player's feet. If it was a weapon I would assume that it'd get picked up right away, unless scripted to move somewhere else.

I can't say for sure how the player would "get" the weapon by calling this command. I took a look into the source and I can't see how that could happen...

Quote: "Whoa, even I didn't know that. I always thought that was a redundant parameter in the default shoot script. That an Merrvaro told me that the parameter was useless and I should remove it from my script (that was a long, long time ago...)."


Yes, looking into the source revealed this. If anyone really is interested as to how it actually effects the outcome, I can copy the section that refers to it, and they can sort through it. All I can really say for sure is that it has something to do with the vertical angle of sight.


Anyone else find something NOT talked about in the manual? Or something wrong with it in terms of scripts?


The one and only,
~PlystirE~

In Soviet Russia, road forks you!

<img src="http://www.danasoft.com/sig/PlystiresRoadSign.jpg" border="0">
xplosys
18
Years of Service
User Offline
Joined: 5th Jan 2006
Playing: FPSC Multiplayer Games
Posted: 7th Oct 2007 17:30 Edited at: 7th Oct 2007 17:36
What I found with PLAYERDROP, and I think Slide found the same issue (as you also mention above), the command must be used in the entities active script. In other words, the command PLAYERDROP will only work for that weapon if the player gets within the range specified in the weapons pickup script.

This is not relevant for the weapon once it has been picked up because the pickup script is no longer active. If you place an identical weapon on the ground, you can use PLAYERDROP instead of PLAYERTAKE and the player will loose that weapon from his inventory. That in itself would be useful if the weapon would not continue to be available and work until the player either tried to switch weapons or put it down by pressing 0. That and the fact that the weapon slot is not cleared by this action, make it difficult to use effectively.

Best.

EDIT: A workaround may be to place a weapon somewhere in a level that is outside of the players reach, and instead of using PLRDISTWITHIN, activate it by another event or means. Then continue to script the PLAYERDROP once the script is activated. If the player has that weapon in his inventory, it will no longer be available. If he is using it however, he will continue to have use of it until he either tries to switch weapons or put it down using 0.

I'm sorry, my answers are limited. You must ask the right question.

Plystire
21
Years of Service
User Offline
Joined: 18th Feb 2003
Location: Staring into the digital ether
Posted: 7th Oct 2007 21:45
I suppose, given some time and testing, you could rescript the pickup.fpi to tell the player if their current weaponlist is full, then if they so choose, they can press the number of a weapon that they want to switch with. IE. there's a gun on the ground but the player's list is full so they press the number of the weapon they want to swap out for the new one.


The one and only,
~PlystirE~

In Soviet Russia, road forks you!

<img src="http://www.danasoft.com/sig/PlystiresRoadSign.jpg" border="0">
Airslide
20
Years of Service
User Offline
Joined: 18th Oct 2004
Location: California
Posted: 8th Oct 2007 01:12
The problem I found is that you have to give the weapon to the player before you can take it. Even if you already have the weapon, you need to have last obtained it from the same pickup object as is calling the drop. If you looked at any of my scripts for dropping the weapon you'd see I called playertake and then playerdrop. I guess it drops it based on an ID that is related to the pickup. Anyways, it's really too much of a mess to use well.


Vote today and play the games!
Plystire
21
Years of Service
User Offline
Joined: 18th Feb 2003
Location: Staring into the digital ether
Posted: 8th Oct 2007 02:08
Very true... well, anyone know of any more commands we should be on the watch for?


Things not listed in the manual could be of some good use to new scripters. I want to get a nice list going.


The one and only,
~PlystirE~

In Soviet Russia, road forks you!
xplosys
18
Years of Service
User Offline
Joined: 5th Jan 2006
Playing: FPSC Multiplayer Games
Posted: 8th Oct 2007 15:51
SCANCODEKEYPRESSED=X is true when X equals the key code of a pressed key

Best.

I'm sorry, my answers are limited. You must ask the right question.

FredP
Retired Moderator
18
Years of Service
User Offline
Joined: 27th Feb 2006
Location: Indiana
Posted: 8th Oct 2007 18:09
You'll find that some of the commands listed in the manual do not work/do not work properly.
The command to have the player drop the weapon sucks and doesn't work.If it doesn't free up the weapon slot it is useless and doesn't work...my opinion anyways.
I think when TGC releases a more current version of the FPSC source code I am going to play havoc with the weapons setup...
Things like this and secondary fire/melee attack are interesting to me and I can't wait to see what I can do.

Please have mercy and use the search function.
Plystire
21
Years of Service
User Offline
Joined: 18th Feb 2003
Location: Staring into the digital ether
Posted: 8th Oct 2007 22:45
I agree, FredP, I, too, am looking forward to getting my hands on the newest source.

Having to deal with the bugs from V1.0 is a pain, and trying to get rid of them is just a waste of time if someone has already done this.

I would definitally put in functionality for a right-mouse button grenade


The one and only,
~PlystirE~

Dammit, Jim! I'm a programmer not a graphic designer!!!
Airslide
20
Years of Service
User Offline
Joined: 18th Oct 2004
Location: California
Posted: 10th Oct 2007 03:50
Quote: "Things like this and secondary fire/melee attack are interesting to me and I can't wait to see what I can do."


You good with DBP? I hope so, cause sifting through the thousands upon thousands of lines of code is a real pain, and once you do find what you're looking for you have to deal with strangely named variables and routines that make no sense watsoever.

No offense meant to Lee of course, and I'm sure he understands them


Vote today and play the games!
Plystire
21
Years of Service
User Offline
Joined: 18th Feb 2003
Location: Staring into the digital ether
Posted: 10th Oct 2007 04:19
Actualy, Airslide, after looking into the source myself, I found it rather easy to decipher the meaning behind most of the variables and types.

I'm just not altering the source right now because I'm using empty's mod and recreating what he's already done (And what I am using in my game) would be a pain. I'd sure like to talk with him about his source so maybe we could, as a community, start making some massive changes of our own and benefit everyone.


The one and only,
~PlystirE~

Dammit, Jim! I'm a programmer not a graphic designer!!!
FredP
Retired Moderator
18
Years of Service
User Offline
Joined: 27th Feb 2006
Location: Indiana
Posted: 10th Oct 2007 04:20
Quote: "You good with DBP? I hope so, cause sifting through the thousands upon thousands of lines of code is a real pain, and once you do find what you're looking for you have to deal with strangely named variables and routines that make no sense watsoever.

No offense meant to Lee of course, and I'm sure he understands them "


I have a basic understanding of DBP (I am by now means an expert) and your right about the code for v1.It can hurt your head just reading it.Like you I am sure that those who made the engine probably had some kind of organization in mind but I fail to see it as well.
This is all just wishful thinking unitl they release a more current version of the source code.
I'm not promising anything but I'm going to give it the old college try...
We probably all have our own little mods we want to make for FPSC.Those that are successful will have to find one lucky person (read:victim) to combine all of the mods together into something that works...

Please have mercy and use the search function.
Plystire
21
Years of Service
User Offline
Joined: 18th Feb 2003
Location: Staring into the digital ether
Posted: 10th Oct 2007 08:45
Quote: "We probably all have our own little mods we want to make for FPSC.Those that are successful will have to find one lucky person (read:victim) to combine all of the mods together into something that works..."


I think if everyone followed along with a "Unified Mod" then it wouldn't be so hard.

If I had the time to do some serious modding, I would be willing to be the "lucky person", as long as:

1) Everyone provided DETAILED instructions on how they modified their code to make what they did.
2) Everyone involved would be willing to help mod certain requests from posters.

I would love to help make an "Ultimate Mod" for the community to use, but in order to do that, I know there'd be tons of requests and there would have to be some DBP programmers willing to put forth some effort to program in some requests.

Like say we set up a sticky thread where people can post up their requests for mods, and out of the volunteer modders we can split up the work to start putting in all of the desired modifications. Compiling a full list of what people would like and which parts each modder is currently working on would be extremely helpful. Then once the modders feel it's time for a release, I would be willing to compile everything done into a .exe that we could post up here for everyone to download and use!


The one and only,
~PlystirE~

Dammit, Jim! I'm a programmer not a graphic designer!!!
Plystire
21
Years of Service
User Offline
Joined: 18th Feb 2003
Location: Staring into the digital ether
Posted: 12th Oct 2007 12:01
Here's one I just found:

Condition: anykeywithinzone = X

Description: Is true if there is a key (that is also listed inside another entity's UseKey field) within the zone boundaries and X is 1.


This command seems kind of useless, since you can't drop keys. But I bet if you wanted the key to be spawned when something happened, this just MIGHT be of some use.

Anyway, it's not in the manual, so I put it here.


The one and only,
~PlystirE~

Dammit, Jim! I'm a programmer not a graphic designer!!!
Doctor Who
17
Years of Service
User Offline
Joined: 6th Sep 2007
Location: Here, somewhere.
Posted: 18th Nov 2007 17:34
RATEOFFIRE. I see it in the conditions with no parameters and yet can't find it in the manual.

The Doctor

I straddle the line between genius and insanity. Guess which side I'm on now?
The Eye of the Storm
16
Years of Service
User Offline
Joined: 1st Mar 2008
Location:
Posted: 4th Mar 2008 12:32
Rate of fire is the one I was going to say. I found it in the homing script...I assume it affects the ai fire rate since its a command?

And even in our sleep, pain which cannot forget falls drop by drop upon the heart, until in our own despite, against our will, comes wisdom.

Login to post a reply

Server time is: 2024-11-24 01:47:58
Your offset time is: 2024-11-24 01:47:58