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 / Force player to look at an entity

Author
Message
SpyDaniel
18
Years of Service
User Offline
Joined: 4th Feb 2006
Location: United Kingdom
Posted: 4th Jun 2010 17:14
I've been looking through all the vanilla conditions and actions but can't find any that would force the player to look at an entity and follow it. Basically, I am making a script that disables the players movement and controls, but I want the camera that the player sees out of to watch an entity that will walk towards the player.



Your signature has been erased by a mod - please reduce to no larger than 600 x 120 please
Plystire
21
Years of Service
User Offline
Joined: 18th Feb 2003
Location: Staring into the digital ether
Posted: 4th Jun 2010 20:16
Quote: " vanilla conditions and actions "


You won't find any in vanilla FPSC.

PB has camera manipulating commands that you can use. It also includes AirMod which has a command to force the player to look at an entity (even with a Y offset value! How nice )

Perhaps you should consider using AirMod for this?


The one and only,


SpyDaniel
18
Years of Service
User Offline
Joined: 4th Feb 2006
Location: United Kingdom
Posted: 4th Jun 2010 21:52
Thanks Plystire for pointing that out, i'll give airmod a go.

I don't understand why Project Blue is pay to use, as it seems to consist of free mods, what are people getting other than the freely available mods packaged in? But I was thinking of buying it, until I ran out of money for this month :\

Your signature has been erased by a mod - please reduce to no larger than 600 x 120 please
Flatlander
FPSC Tool Maker
17
Years of Service
User Offline
Joined: 22nd Jan 2007
Location: The Flatlands
Posted: 4th Jun 2010 23:00
That is one of airmod commands that I incorporated into RPG Mod. I changed the command name but I have given credit to airmod in the document ion and here. It is:

rpg_pointplayeratobject

It has no parameters so I'm not sure if there is a y offset unless it was automatically done. I just copied the code.

I have used it on several occasions in my educational games.

Plystire
21
Years of Service
User Offline
Joined: 18th Feb 2003
Location: Staring into the digital ether
Posted: 4th Jun 2010 23:02 Edited at: 4th Jun 2010 23:03
Quote: "I don't understand why Project Blue is pay to use, as it seems to consist of free mods, what are people getting other than the freely available mods packaged in?"


Project Blue does indeed contain free Mods, but it also contains the one Mod that was never properly released.... Mine.

Ply's Mod brings a large compendium of scripting commands and features that are not available in any other Mod. This includes, but is not limited to:
- Dual-wielding
--- Allows for certain weapons (defined by YOU) to be dualwielded
--- Includes ability to define transition animations between dualwielding and singlewielding as well as other dual-wielding related animations

- Camera system
--- Can create your own cameras and manipulate them through scripts, including positioning and angling.
--- Can define camera to follow entity
--- Can define entity to follow camera

- Extensive variable system
--- Very easy to use, and can use variables with ANY other scripting command (Both actions and conditions)
--- Allows scripter to utilize internal variables as well, such as Player Health, Player Ammo, Coordinates relating to player or entities, camera related values, etc.
--- Is tied directly into the numeric HUD system for ease of display without use of raw text ( raw text is very unprofessional looking)

- Ammo pooling through use of variables
--- Allows weapons to pool ammo together (making it so certain weapons share a stock of ammo)
--- Allows scripter to take direct control over weapon ammo by use of the variable system

(And here come the kickers )

- Weapon scripting
--- Allows individual player weapons to follow their own unique scripts, differentiating them from other weapons
--- Can redefine keys for weapon use
--- Allows scripter to do many things that weapons couldn't before, including but not limited to: Forced reloads, weapon jamming, auto-firing, target control (used for things such as gravity guns), forced zooming (such as forcing to zoom out when reloading), etc.

- Full Screen Shader system
--- The Mod is not bound to specific full screen shaders
--- Users can make their own shaders and define them through the Mod, swapping between them when necessary
--- Mod comes with shaders for you, so you don't have to make your own to use the system. These include Bloom, Black and White, and Motion Blur (and a combination of Bloom and Motion Blur)
--- Scripters may manipulate tweakable variables within the defined shaders at any given time, allowing the shaders to perform dynamically during gameplay.


Those are just some of the features unique to Ply's Mod. What really allows it to excel is the scripting additions I've implemented for it. Those additions are what allow scripters to make things such as vehicles or third person views. Things like security cameras are no longer impossible by way of the camera system, swapping view between the player camera and a camera bound to a "security camera" entity. Such things are not "features" of Ply's Mod, but are possible to make by using the new script commands.


As you can see, although Project Blue does consist of free Mods, it brings together the functionality of all of those free Mods alongside my own Mod which brings everything I've mentioned above and more.

I hope that answers your question and clears up the difference between Project Blue and the other Mods.

[/Shameless Self-Advertising]


The one and only,


Flatlander
FPSC Tool Maker
17
Years of Service
User Offline
Joined: 22nd Jan 2007
Location: The Flatlands
Posted: 4th Jun 2010 23:42
I think PB also has a compass and rain? If I'm not mistaken.

mgarand
16
Years of Service
User Offline
Joined: 22nd Dec 2007
Location: The Netherlands
Posted: 5th Jun 2010 00:01
yup



Creativity is inventing, experimenting, growing, taking risks, breaking rules, making mistakes, and having fun.
Plystire
21
Years of Service
User Offline
Joined: 18th Feb 2003
Location: Staring into the digital ether
Posted: 5th Jun 2010 02:10 Edited at: 5th Jun 2010 02:25
Compass and rain were from knxrb not Ply's Mod, so I didn't include them in the list of features. What I listed was solely from Ply's Mod since he wanted to know what PB offered aside from free Mods.


Sorry, Flatlander... didn't see your first post. Looks like you posted while I was typing. Guess we both had a share in shameless self-advertising here. Lol

Quote: "It has no parameters so I'm not sure if there is a y offset unless it was automatically done."


Maybe I dreamt that part up... Never know, lol. Would be a nice thing to have, though, for looking people in the face, or looking at the base of a large structure.


The one and only,


SpyDaniel
18
Years of Service
User Offline
Joined: 4th Feb 2006
Location: United Kingdom
Posted: 5th Jun 2010 03:12
The rpg_pointplayeratobject action will work for what I wanted, I only want the player to look in the general area of the entity coming towards them, as long as there are no side effects, such as if the player ran up to the trigger looking at the floor, would the players view be reset to the default xy axis, or would the player be looking at the floor but in the direction of the entity?

Windows 7 Home Premium 64-bit, AMD Phenom II X4 940 3.0Ghz, 2.0GB Single-Channel DDR2 @ 400MHz, ATI Radeon Sapphire HD 5770 Vapor-X
Flatlander
FPSC Tool Maker
17
Years of Service
User Offline
Joined: 22nd Jan 2007
Location: The Flatlands
Posted: 5th Jun 2010 05:01 Edited at: 5th Jun 2010 05:02
Quote: "Compass and rain were from knxrb not Ply's Mod, so I didn't include them in the list of features. What I listed was solely from Ply's Mod since he wanted to know what PB offered aside from free Mods"


So are the compass and rain from a "free" mod, then?

@Higgins


It seems to basically center on the entity. If the player is looking at the floor then it will readjust to the object player is to look at.

Say the player is walking perpendicular to the object and is looking straight ahead, the object is on the floor to the player's right. The player walks into a TZ that will point the player to the object. Suddenly, the player is looking at the object that is on the floor.[b]

SpyDaniel
18
Years of Service
User Offline
Joined: 4th Feb 2006
Location: United Kingdom
Posted: 5th Jun 2010 05:17
So its not a smooth transaction, its instant? Could look a bit odd, being sanpped to the entity. Would you work on a new action in the future, so its more fluid, as if the player is turing their head towards the entity?

Windows 7 Home Premium 64-bit, AMD Phenom II X4 940 3.0Ghz, 2.0GB Single-Channel DDR2 @ 400MHz, ATI Radeon Sapphire HD 5770 Vapor-X
Flatlander
FPSC Tool Maker
17
Years of Service
User Offline
Joined: 22nd Jan 2007
Location: The Flatlands
Posted: 5th Jun 2010 05:21 Edited at: 5th Jun 2010 05:22
Here are two screen shots to show what happens. The entity is not on the floor but is a npc mummy.

The first image shows the player looking at the floor. He is walking forward in this manner. Now who in their right mind would be walking like this?



Player walks into TZ. Suddenly, he is pointed to the mummy. The first text message is, "Maybe I can ask the Mummy." (for a password) and then this message flashes up along with looking at the mummy.



Flatlander
FPSC Tool Maker
17
Years of Service
User Offline
Joined: 22nd Jan 2007
Location: The Flatlands
Posted: 5th Jun 2010 05:26 Edited at: 5th Jun 2010 05:42
Quote: "So its not a smooth transaction, its instant? Could look a bit odd, being sanpped to the entity. Would you work on a new action in the future, so its more fluid, as if the player is turing their head towards the entity?"


You're right it is not smooth but an instantaneous action.

I could look at how airmod coded it and see if I can mess with the camera movement of the player bobble.

Addendum:

Airmod took the easy way out and I would have too I'm sure. There is a DBPro command (EDIT-9:41) - point camera - that is being utilized for this. So there will be no slow transition from looking in one direction to looking in another direction towards the object of interest.

Plystire is also correct and I didn't really pay any attention to this and therefore it isn't documented. If you place a parameter to this action, it will change the Y position by the amount given. It will be added to the objects Y Position. As Plystire said that would be an enhancement to the command.

I'm not sure I will take the time to see if a smoother transition can be done; but, I will put it on my list of things to look at.

Plystire
21
Years of Service
User Offline
Joined: 18th Feb 2003
Location: Staring into the digital ether
Posted: 5th Jun 2010 06:10
I could have sworn the transition was smooth. That may have been one of my changes to AirMod's code, not sure.

Terry, there should be some pre-existing "smooth" camera transitions in AirMod. What I typically did for utilizing this was, instead of making new code, I simply added to the "offset" the camera needed to reach it's desired angle/position. Since the offset was globally used to transition the camera to a new angle/coordinate, it could be used in any place within the source and reach the same effect.

Smooth transitions are most easily accomplished via: val# = curvevalue(targetval#, val#, speed)
(Where "speed" is how many frames it should take to get to the final value. A good one to use for a quick smooth transition is anywhere from 3-8. I normally use 5 to start out and tweek it from there)

As a side note, you will need to account for mouse movement (which changes the camera angle as well) and if the command for changing the angle has been called during the loop, you may want to cut off mouse movement to prevent that. If mouse movement is not cut off, what I foresee happening is that player will be able to move the view very quickly away from looking at the object and, if the command is still be issued, the view will continue to smoothly reset back onto the object being viewed. It could be a nice effect and if you like allowing the player to look around a little while in that mode you can just forget about disallowing mouse movement.


Hope that helps.


The one and only,


Flatlander
FPSC Tool Maker
17
Years of Service
User Offline
Joined: 22nd Jan 2007
Location: The Flatlands
Posted: 5th Jun 2010 08:01 Edited at: 5th Jun 2010 08:05
Thanks Plystire. I am going to copy and save it to look at more closely later. Appreciate it.

The following is airmod's command. Since his is a free mod I don't think he will mind my revealing it. Quite simple actually.

point camera object position x(obj),object position y(obj)+aiactionseq(seq).value,object position z(obj)

This is the DBPro command I use in my mod. With this command there is no smooth slow turning of the camera. It just simply points immediately to the 3D coordinates. You can see where the Y offset can be adjusted. That's in his doc but not mine as I sort of spaced it.

What I believe Higgins wants (correct me if I'm wrong) is a slower look or camera movement to the object coordinates. One could say this command is smooth actually, it's just FAST.

I'm sure that this is what is in PB as well only with the command name "plrpointatobject" as is indicated by Airmod's manual. Now, Plystire might have changed the DBPro code, I couldn't say.

So, the only command out there is this one since most people have utilized airmod in their mods.

SpyDaniel
18
Years of Service
User Offline
Joined: 4th Feb 2006
Location: United Kingdom
Posted: 5th Jun 2010 12:37
The reason I was saying about the player looking at the floor, was because some people do not pay attention to what is going on in the level, so if they are looking away from where the entity will come from, then they will be froze (by my script) and their view instantly changed to where the entity is, probably making it feel a bit weird.

On another side, maybe it would be better if the player had to "see" the entity first, not the entity "see" the player and then "plrdisable" and run the action to make the player look at the entity.

I basically want the player to feel as if they have lost control due to this entity being in presence of them and then the player being drawn in to look at this entity, being a horror npc in this case.

Is there a condition that checks to see if the player is looking at an entity?

Windows 7 Home Premium 64-bit, AMD Phenom II X4 940 3.0Ghz, 2.0GB Single-Channel DDR2 @ 400MHz, ATI Radeon Sapphire HD 5770 Vapor-X
Plystire
21
Years of Service
User Offline
Joined: 18th Feb 2003
Location: Staring into the digital ether
Posted: 5th Jun 2010 22:13
Again, you're wanting an AirMod command. This time it's called "pickobject=X" (X is 1 for when the player is looking at the object... aka, their crosshairs are on the object.)

Now, I'm not sure how well this would play out the way you're talking about doing it. What would happen if one of the players knows what's going to happen and decides to walk through the room backwards, avoiding all sort of eye contact with the entity? Would that break your map at all?


The one and only,


Flatlander
FPSC Tool Maker
17
Years of Service
User Offline
Joined: 22nd Jan 2007
Location: The Flatlands
Posted: 6th Jun 2010 00:10 Edited at: 6th Jun 2010 00:26
Quote: ""pickobject=X""


That one I didn't include because I was thinking a lot of the times my players wouldn't have a weapon and therefore no crosshair available. Again, didn't really take a look at it so don't know if a crosshair is necessary. Sorry, this really isn't a part of the subject matter but I guess I feel like I'm a part of the thread now.

Addendum:

I just noticed another airmod conditional command:



SpyDaniel
18
Years of Service
User Offline
Joined: 4th Feb 2006
Location: United Kingdom
Posted: 6th Jun 2010 02:13
Hummm, might need to explain that, as I am quite drunk again, last proper day to get drunk before I have work again, any information on what it means, remember I am drunk :\, not being very helpful sorry.

Windows 7 Home Premium 64-bit, AMD Phenom II X4 940 3.0Ghz, 2.0GB Single-Channel DDR2 @ 400MHz, ATI Radeon Sapphire HD 5770 Vapor-X
Plystire
21
Years of Service
User Offline
Joined: 18th Feb 2003
Location: Staring into the digital ether
Posted: 6th Jun 2010 07:11 Edited at: 6th Jun 2010 07:14
If you do the following:


The script will point the player toward the entity ONLY if the player is aiming at the entity... however, with the condition you will then be able to freeze the player and force them to continue looking at the entity.


Hope that made sense. I'm not very proficient conversing with drunk people.


On a side note, Higgins, I received a virus-implanted email from you.... just so you know, you might wanna look into fixing whatever it is that got a hold of your email.


The one and only,


SpyDaniel
18
Years of Service
User Offline
Joined: 4th Feb 2006
Location: United Kingdom
Posted: 6th Jun 2010 12:26
Which email, my current one? I don't believe I have any viruses, I scan my system and it should have alerted me. I don't know why you got an email from me, when did you receive it?

I shouldn't get drunk and post XD, surprised it made sense though.

I'll give what you said a go and see what happens.

Windows 7 Home Premium 64-bit, AMD Phenom II X4 940 3.0Ghz, 2.0GB Single-Channel DDR2 @ 400MHz, ATI Radeon Sapphire HD 5770 Vapor-X
Plystire
21
Years of Service
User Offline
Joined: 18th Feb 2003
Location: Staring into the digital ether
Posted: 6th Jun 2010 21:27
It came from this one:

Quote: "Daniel Higgins (atomic_killer_rooster (a_t) hot mail (dot) com)"


Space it out for you to keep email scanners from finding it.


The one and only,


F22Raptor
14
Years of Service
User Offline
Joined: 10th May 2010
Location:
Posted: 14th Jun 2010 12:16
try fenix mod its integrated with horror mod so it has the on rail system its camera system can also be adjusted it has rpg mod its got quit a few actually fps update 1.17 comes out ill need no more mods

<F22>

Login to post a reply

Server time is: 2024-11-24 23:45:54
Your offset time is: 2024-11-24 23:45:54