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 / conditions that are either 1 or 0 ..true or false

Author
Message
Brian In Korea
16
Years of Service
User Offline
Joined: 1st Mar 2009
Location:
Posted: 5th Mar 2009 04:02
The syntax of some of the conditions in FPSC are a little confusing so I thought I would start a thread to point out the issue (for newbies to be aware of and vets to elaborate on).

Look at the condition :associated=
Can associated ever equal 7? It seems like the only useful check would be :associated=1 (used when you want an action to occur when the entity IS associated) and :associated=0 (used when you want an action to occur when the entity is NOT associated)

Other conditions that fit in this category:
:ifweapon=
:animationover=
:plrwithinzone=
:ifmarker=
:entitywithinzone=
:plrusingaction=
:plralive=
:noiseheard=


Personally, I would find it less confusing if they were restructured like :plrcanbeseen and :plrcannotbeseen which don't require an X value.

Other conditions that fall into this category include:
:plringunsight
:hudhavename
:cantake
:reachtarget


The conditions from the first category could be restructured to
:plralive
:plrnotalive
:plrwithinzone
:plrnotwithinzone
Plystire
22
Years of Service
User Offline
Joined: 18th Feb 2003
Location: Staring into the digital ether
Posted: 5th Mar 2009 20:24
The reason "plrcanbeseen" is seperated into two actions is because it CAN accept a parameter that is not correlated to whether or not the player can directly be seen. It specifies bounding parameters for the check, specifically it alters the viewing cone to be used for checking whether the player is visible or not. You can see this in effect in some of the legacy AI scripts.

I personally like that they use the 1/0 structure instead of the "can/cannot" structure. It saves a LOT of code to be written in the engine. Instead of writing two commands, you can just write one command that accepts a parameter of 1 or 0.

The "plrcanbeseen" and "plrcannotbeseen" commands are not like the other ones you've listed to accompany them in their "category". "plringunsight" does not have an opposing condition "plrnotingunsight". "hudhavename" doesn't either, nor do we have a "cannottake" condition.
A more suitable condition to be accompanied with "plrcanbeseen" would have to be "plrdistwithin", which is opposed by "plrdistfurther".


In all honesty, I think it should stay the way it is. People are already used to it, and it makes sense when you think about it.


The one and only,


Brian In Korea
16
Years of Service
User Offline
Joined: 1st Mar 2009
Location:
Posted: 6th Mar 2009 01:26
That makes sense, but will the condition :ifmarker = 7 ever be true? Can the action that follows it ever occur?

Login to post a reply

Server time is: 2025-05-24 11:26:33
Your offset time is: 2025-05-24 11:26:33