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 / Using a script to trigger a light, entity, ect.

Author
Message
Michael Thompson
16
Years of Service
User Offline
Joined: 15th Aug 2008
Location: Behind you (if not, in australia)
Posted: 30th Sep 2010 14:19
Hello all, i have recently been looking for a night vision script, but i found that none of the other scripts suited my needs.

I wish to use a script to activate a light called nvisionlight1, when the button 'n' is pressed. what command would i use to activate this light if possible?

Thanks

Windows 7 ultimate x64, Intel i7, 4 GB RAM, NVIDIA GEFORCE 330m 1GB
Flash Star Game Creations
Michael Thompson
16
Years of Service
User Offline
Joined: 15th Aug 2008
Location: Behind you (if not, in australia)
Posted: 2nd Oct 2010 15:46
Also, I would like the light to follow the player around iff possible. if this is not possible, would it be possible to make a light up entity for the player to carry round with them?

Windows 7 ultimate x64, Intel i7, 4 GB RAM, NVIDIA GEFORCE 330m 1GB
Flash Star Game Creations
Michael Thompson
16
Years of Service
User Offline
Joined: 15th Aug 2008
Location: Behind you (if not, in australia)
Posted: 4th Oct 2010 11:46
Even something that the character picks up like a key? Or something that occupies a weapon slot?

Windows 7 ultimate x64, Intel i7, 4 GB RAM, NVIDIA GEFORCE 330m 1GB
Flash Star Game Creations
Michael Thompson
16
Years of Service
User Offline
Joined: 15th Aug 2008
Location: Behind you (if not, in australia)
Posted: 17th Oct 2010 09:17
dont worry, i remembered it. is there any way to get a light to follow the player around? thanks.

Windows 7 ultimate x64, Intel i7, 4 GB RAM, NVIDIA GEFORCE 330m 1GB
Flash Star Game Creations
Michael Thompson
16
Years of Service
User Offline
Joined: 15th Aug 2008
Location: Behind you (if not, in australia)
Posted: 24th Oct 2010 10:07
Anybody?

Windows 7 ultimate x64, Intel i7, 4 GB RAM, NVIDIA GEFORCE 330m 1GB
Flash Star Game Creations
Brunopark09
14
Years of Service
User Offline
Joined: 7th Jul 2010
Location: Santiago de Chile
Posted: 25th Oct 2010 03:03
If you are using PB or Fenix mod, you can use the xrModmovable lights comands



SCI FI MEDIA IS NEVER ENOUGH!
Michael Thompson
16
Years of Service
User Offline
Joined: 15th Aug 2008
Location: Behind you (if not, in australia)
Posted: 25th Oct 2010 15:09
Is there any way to do this with an unmodded version or project blue, as i cannot afford pb and i have had trouble with fenix?

Windows 7 ultimate x64, Intel i7, 4 GB RAM, NVIDIA GEFORCE 330m 1GB
Flash Star Game Creations
Gencheff
14
Years of Service
User Offline
Joined: 12th Jun 2010
Location: UK by way of USSR
Posted: 25th Oct 2010 17:48
RPG Mod is free and has a flashlight function

Michael Thompson
16
Years of Service
User Offline
Joined: 15th Aug 2008
Location: Behind you (if not, in australia)
Posted: 25th Oct 2010 17:57
Does it change the ambience?

Windows 7 ultimate x64, Intel i7, 4 GB RAM, NVIDIA GEFORCE 330m 1GB
Flash Star Game Creations
Gencheff
14
Years of Service
User Offline
Joined: 12th Jun 2010
Location: UK by way of USSR
Posted: 25th Oct 2010 18:09
you can.As long as you set a big enough light radius

Brunopark09
14
Years of Service
User Offline
Joined: 7th Jul 2010
Location: Santiago de Chile
Posted: 26th Oct 2010 02:43
Quote: "Is there any way to do this with an unmodded version or project blue, as i cannot afford pb and i have had trouble with fenix?"


Nop but you can make a night vision script in stock fpsc without problems

desc = nv

:state=0,scancodekeypressed=49:ambience=100,ambienceblue=0,ambiencered=0,ambiencegreen=255,state=2
:state=2,scancodekeypressed=0:state=3
:state=3,scancodekeypressed=49:ambience=10,ambienceblue=100,ambiencegreen=100,ambiencered=100,state=4
:state=4,scancodekeypressed=0:state=0

SCI FI MEDIA IS NEVER ENOUGH!
Michael Thompson
16
Years of Service
User Offline
Joined: 15th Aug 2008
Location: Behind you (if not, in australia)
Posted: 26th Oct 2010 03:59
OK, well the reason I wanted a light is to prevent changing the ambience, as i wanted to release it to everyone, so that they could just insert it and not need to change the script.
But thanks anyway, maybe i will continue to play with fenix mod (unfortunate i cant do it with vanilla fpsc isnt it?) anybody know of any other mods that allow you to do this? like project green?
also
Quote: "RPG Mod is free and has a flashlight function"
I have RPG Mod as well. How does the flash light function work? does it change the ambience?

Windows 7 ultimate x64, Intel i7, 4 GB RAM, NVIDIA GEFORCE 330m 1GB
Flash Star Game Creations
Flatlander
FPSC Tool Maker
17
Years of Service
User Offline
Joined: 22nd Jan 2007
Location: The Flatlands
Posted: 26th Oct 2010 04:06 Edited at: 26th Oct 2010 04:22
Quote: "I have RPG Mod as well. How does the flash light function work? does it change the ambience?"


No, it doesn't.

If you have version 3.2 or above.

1. rpg_useflashlight=(0 or 1) - 1 turns flashlight on
2. rpg_flashlightrange=integer - any number. If set too low then it doesn't work very well. Remember 100 is a segment unit. Default is 350. Try a larger value if not acceptable.
3. rpg_flashinnerangle=float. Angle values only (0.0-360.0) This angle is where it is the brightest. Default is 0.0. You might also want to try a value of 30.
4. rpg_flashouterangle=float (0.0-360.0) this is where the brightness starts to fall off until it matches the ambiance. Default is 180. If too wide then try a value of 90.
5. rpg_flashlightred=rgb value for red. Use 1-255. Default is 255.
6. rpg_flashlightgreen=rgb value for green. Use 1-255. Default is 255.
7. rpg_flashlightblue=rgb value for blue. Use 1-255. Default is 255.

You can change the color of the light as shown above.

addendum:

Quote: "I wish to use a script to activate a light called nvisionlight1, when the button 'n' is pressed. what command would i use to activate this light if possible?"


The following was done in vanilla engine.

A night vision type script I used once was where the ambience was either black or very close to black. When the player put's his night vision goggles on (say pressing the "n" key) I change the ambience color to green and I increase the ambiance brightness to a brighter ambiance. If you have FPI EditPad then go to the right of the pad and left click on the "actions" tab. Then right click on the same tab and you will see a drop down list. Find light/ambience and select it. You will then see all the ambience action commands.

Pressing another key or the same key then you would return the ambience to what it was originally.

Using RPG Mod you could make this more interesting by the player needing to pick up the goggles (or flashlight) before they (it) can be used. Then in order to use them the player would have to take them out of his inventory pack. If he doesn't, then pressing "n" will do nothing. But when he has them in his possession then pressing "n" would change the ambience or turn on the flashlight. Actually "f" is hard coded for turning flashlight on and off. However, if you have to set the use of the flashlight to 1 in order to use. It is automatically turned on when used for the first time.

I reject your reality and substitute my own!

Add more adventure to your game -- use RPG Mod
Michael Thompson
16
Years of Service
User Offline
Joined: 15th Aug 2008
Location: Behind you (if not, in australia)
Posted: 26th Oct 2010 04:53
Quote: "Using RPG Mod you could make this more interesting by the player needing to pick up the goggles (or flashlight) before they (it) can be used."
Thats the plan.
Quote: "Quote: "I have RPG Mod as well. How does the flash light function work? does it change the ambience?"

No, it doesn't."
Awesome! This is exactly what I want! (I will be downloading the update today if i can get on my emails to get the credidentials)

Quote: "If you have FPI EditPad"
I have the installer somewhere, but i primarially use notepad ++. I will go and play with it when I get home then.

So this flashlight, is it just a light that follows the player around?

Thanks

Windows 7 ultimate x64, Intel i7, 4 GB RAM, NVIDIA GEFORCE 330m 1GB
Flash Star Game Creations
Flatlander
FPSC Tool Maker
17
Years of Service
User Offline
Joined: 22nd Jan 2007
Location: The Flatlands
Posted: 26th Oct 2010 05:42 Edited at: 26th Oct 2010 05:43
Quote: "So this flashlight, is it just a light that follows the player around?"


Well, it doesn't actually follow the player. It is in front of the player at all times (at eye level actually) when it is on. When the player camera turns the flashlight turns with it. (When using the mouse or joystick).

RE: FPI EditPad

If you install this make sure and get the update on the official thread that is stickied at the top of this forum.

I reject your reality and substitute my own!

Add more adventure to your game -- use RPG Mod
Michael Thompson
16
Years of Service
User Offline
Joined: 15th Aug 2008
Location: Behind you (if not, in australia)
Posted: 26th Oct 2010 12:59
so you are saying that the light follows the player, when the light is on, and when it is off, it doesnt follow them around?
(if thats not what you mean, you have done something previously thought impossible - you confused me)

Windows 7 ultimate x64, Intel i7, 4 GB RAM, NVIDIA GEFORCE 330m 1GB
Flash Star Game Creations
Flatlander
FPSC Tool Maker
17
Years of Service
User Offline
Joined: 22nd Jan 2007
Location: The Flatlands
Posted: 26th Oct 2010 20:55 Edited at: 26th Oct 2010 21:33
Here is a video.

http://www.youtube.com/watch?v=4cQDL2JaAXs

I call it a pseudo flashlight because it is not real good. This is one of those more "powerful" flashlights as it covers more of an area. One of the issues is that if you make the player look down then it is black. Does not show a light. I have an idea why this is happening so someday soon I will check it out. However, no time right now. I will do a video of the night goggles later.

Addendum:

I forgot to mention that I was not the first to do a "flashlight." Both Fenix and PB mods have flashlight feature. I believe they, too, use a DBPro spotlight. Theirs may be better but I don't know since I haven't checked them out.

I reject your reality and substitute my own!

Add more adventure to your game -- use RPG Mod
Flatlander
FPSC Tool Maker
17
Years of Service
User Offline
Joined: 22nd Jan 2007
Location: The Flatlands
Posted: 26th Oct 2010 22:03 Edited at: 26th Oct 2010 22:18
Here is a video of changing the ambiance to green simulating night goggles. It only works indoors as the ambiance colors do not affect the skybox. When you walk into the room the ambiance changes. Actually you would probably wait until you are in the room and putting on your goggles to change the ambiance. You will notice that when you look towards the door it is actually black. I place a black entity wall in front of the door and did not spawn it until I went into the room. The reason for having to do this is because it would look silly with a green ground (because of ambiance) and a black starry sky. It all should be green but it isn't. You could also make the door shut after going inside. A trigger zone just before the door would turn the ambiance back to what it was.

http://www.youtube.com/watch?v=8jbgEGx8MbQ

To make it even more believable you could put up a black eye hud.

Addendum:

Here is the script I used. Very simple.



The activateifused=1 spawns the black wall.

I reject your reality and substitute my own!

Add more adventure to your game -- use RPG Mod
Michael Thompson
16
Years of Service
User Offline
Joined: 15th Aug 2008
Location: Behind you (if not, in australia)
Posted: 27th Oct 2010 06:29
OK, i looked at your video (and subscribed to your channel (im sure you could guess who I am)) and the night vision looked good, as did the flashlight, however, I do not wish to toy with the ambience (as I wish to use the night vision goggles in most of my levels, most of which are daytime ones) which is why I wanted to use a light, however, that flashlight looks good. Maybe then I will set it so that when the player presses n, it shows the night vision goggles.

Anyway, the flashlight isnt too bad. Good work

Thanks.

Windows 7 ultimate x64, Intel i7, 4 GB RAM, NVIDIA GEFORCE 330m 1GB
Flash Star Game Creations

Login to post a reply

Server time is: 2024-11-24 16:43:58
Your offset time is: 2024-11-24 16:43:58