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 Product Chat / Making enemies react to light?

Author
Message
SekoIdiootti
17
Years of Service
User Offline
Joined: 14th Mar 2009
Location: Finland
Posted: 28th Jan 2010 22:02
Well, I know this is a really noobish and stupid question... But is it possible to make enemies react to light like the nurses in Silent Hill? Because that would be SOOOO awesome!
I mean, like with EAI's flashlight on, they'd attack...

Shadowtroid
16
Years of Service
User Offline
Joined: 23rd Dec 2009
Location: nope
Posted: 28th Jan 2010 22:05
Hmmm...

You could set the shoot script to only work when keypressed=33 1.

That means whenever you are pressing F they will attack.

Or you could set it to activate when you press F...

But that's assuming you're prssing F to use it. If that's not what you're looking for, then I don't know.

"And we played the first thing that came to our heads...Just so happened to be... the best song in the world...

it was the best song in the world..."
SekoIdiootti
17
Years of Service
User Offline
Joined: 14th Mar 2009
Location: Finland
Posted: 28th Jan 2010 22:21
Well, mouse's left button... It's not possible to make it so that they attack when that's pressed?

Doomster
18
Years of Service
User Offline
Joined: 8th Nov 2007
Location: Germany
Posted: 28th Jan 2010 22:23 Edited at: 28th Jan 2010 22:24
You're able to check the current used weapon with Project Blue/Green, and therefore also with Fenix Mod, it's also possible to check, if the player shoots/uses the mouseclick... so, such a enemy script is definitely possible.

-Doomster

Shadowtroid
16
Years of Service
User Offline
Joined: 23rd Dec 2009
Location: nope
Posted: 28th Jan 2010 22:23 Edited at: 29th Jan 2010 00:11
Maybe, maybe...

I don't know enough about this to know, sorry.

Ask around. Someone's bound to know the left click's key #. It's just not me.

Wish I could help.

EDIT: Ninja'd by doomstar.

"And we played the first thing that came to our heads...Just so happened to be... the best song in the world...

it was the best song in the world..."
SekoIdiootti
17
Years of Service
User Offline
Joined: 14th Mar 2009
Location: Finland
Posted: 28th Jan 2010 22:36
Doomster: Cool. Hmm, in Fenix Mod, how do I do that?

zeza
18
Years of Service
User Offline
Joined: 27th Jun 2008
Location:
Posted: 29th Jan 2010 02:34
In Fenix mod you can check if the mouse is clicked by using mouseclick=x where x=1 is left, x=2 is right.

Hope This Helps
SekoIdiootti
17
Years of Service
User Offline
Joined: 14th Mar 2009
Location: Finland
Posted: 29th Jan 2010 09:42
...
I don't understand anything about script commands...
I'd need a script that would be like that... I'm so so so sorry, I'm just not really understanding...

KeithC
Senior Moderator
20
Years of Service
User Offline
Joined: 27th Oct 2005
Location: Michigan
Posted: 29th Jan 2010 13:45
Wouldn't you want something (script) that detects the activation button (mouse button) for turning on the light, then does a check to see if you are within range of the enemy? Possibly adding to those two checks would be an orientation check to make sure you are facing the enemy within a certain radius (ie., 30 degree left or right variance)?

-Keith
SekoIdiootti
17
Years of Service
User Offline
Joined: 14th Mar 2009
Location: Finland
Posted: 29th Jan 2010 13:46
That would be awesome. But since I can't make any scripts... It's just a dream. Unless I'd ask someone else to do it, LOL!

Kravenwolf
17
Years of Service
User Offline
Joined: 14th Apr 2009
Location: Silent Hill
Posted: 29th Jan 2010 13:54
Yeah, like Keith said, I'm sure it would be possible in Project Blue/Fenix Mod to set a variable to 1 whenever the flashlight is turned on, and whenever that variable is 1, the monsters will notice the player and attack.

You might also be able to set it up in a way that some of the monsters will walk waypoints, and as long as the player has the flashlight turned off, they can walk right behind a monster to get down a hallway without being noticed. (Forbidden Siren)

Kravenwolf

SekoIdiootti
17
Years of Service
User Offline
Joined: 14th Mar 2009
Location: Finland
Posted: 29th Jan 2010 14:19
Wow, that'd be so awesome!
But... Byääh.

Marc Steene
FPSC Master
20
Years of Service
User Offline
Joined: 27th Mar 2006
Location: Bahrain
Posted: 29th Jan 2010 18:42
Here's the script you want...it's fairly simple but it's a bit of a botch job in that it's a work around but the simplest method to do it without detecting camera angles etc. Also, this will only work in Project Green (In Project Blue, blood will spray like mad because I can't see a way to disable blood without deleting the actual file) and it should work in Fenix Mod (depending on which actions were added).

In the Zombie Nurse script, replace the first two lines with:

:state=0:rpg_showblood=0
:state=0,plrdistwithin=300,shotbyweap=eai\ledwhite 1:state=1

Then go to files\gamecore\guns\EAI\LEDWHITE\gunspec.txt and change the range to around 150-200 and save. That should achieve the desired effect, it's just the values may need to be edited (and if you want to use a different coloured LED, change the names.


[b]FPSC MIGRATION: http://forum.thegamecreators.com/?m=forum_view&t=142497&b=21
SekoIdiootti
17
Years of Service
User Offline
Joined: 14th Mar 2009
Location: Finland
Posted: 29th Jan 2010 19:19
Wow thanks, Marc!
I love you, I love you, I love you!!!
...I know that sounds gay. But I just... really. You're such an awesome person. Also, I sent you an email.

SekoIdiootti
17
Years of Service
User Offline
Joined: 14th Mar 2009
Location: Finland
Posted: 29th Jan 2010 19:44
Hmm... I wonder, why I the flashlight now suddenly is like... shooting, lol. I changed the range, and... well, it causes bullet holes to appear everywhere I "shoot" with it, lol.

Metal Devil123
18
Years of Service
User Offline
Joined: 13th Jul 2008
Location: Suomi, Finland
Posted: 29th Jan 2010 20:13
Well, I quess that if you make so that you can't leave bullet holes anywhere, then that could be nicer, but then weapons would leave no bullet holes eather.

Marc Steene
FPSC Master
20
Years of Service
User Offline
Joined: 27th Mar 2006
Location: Bahrain
Posted: 29th Jan 2010 20:18
Let's not forget - the LED isn't just a light, it's a weapon, and FPSC handles it like one. The light is produced from the muzzle flash (a really clever way of achieving the effect of a torch, well done Errant). When you change the range, the LED is shooting a bullet. The enemy detects whether it has been shot by the LED, and if it has, it starts attacking the player. This is just a work around method which isn't perfect, I'm sure there is a more complicated way to do it using cameras, though.


[b]FPSC MIGRATION: http://forum.thegamecreators.com/?m=forum_view&t=142497&b=21
Errant AI
19
Years of Service
User Offline
Joined: 24th Aug 2006
Location:
Posted: 29th Jan 2010 21:57 Edited at: 29th Jan 2010 22:06
Increasing the LED range is just sort of a really bad idea, esp. with the other options in PB.

In Project Blue/Green it is better to use a combo of, plrfiredweap, inview, plrcanbeseen and plrdistwithin conditions to trigger the enemy.

state=[whatever],plrdistwithin=300,inview=1,plrcanbeseen=1,plrfiredweap=eai\ledwhite:state=[whatever]

This would make it so that the LED light must be in use, the enemy is on screen (and assumed to be in the light beam), reasonably close, and can see the player (light in it's eyes) before attacking.

If using Fenix, there is the usingweapon=x condition but I don't know if that means pressing fire or just holding the weapon. Either way, you could use that as the basis for a similar script for that mod. Inview is from AirMod and usable with either mod. It could be substituted with pickobject but that's a little more finicky.
Shadowtroid
16
Years of Service
User Offline
Joined: 23rd Dec 2009
Location: nope
Posted: 29th Jan 2010 22:02
What about something like

:state=0,plrdistwithin=300,usingweapon=1(or whatever weapon slot the flashlight is),mouseclick=1:state=1
:state=0,plrdistwithin=300,shotbyweap=(directory for unarmed) 1:state=1

That would only work in Fenix Mod, but if you:
Use flashlight, it'll see you and attack.
Hit it with unarmed (and only if you hit it) it'll attack you.
If you use a gun, it'll still have bullet holes.
However, if it is shot, it'll do nothing.

Hope that helps a little.

"And we played the first thing that came to our heads...Just so happened to be... the best song in the world...

it was the best song in the world..."
Marc Steene
FPSC Master
20
Years of Service
User Offline
Joined: 27th Mar 2006
Location: Bahrain
Posted: 29th Jan 2010 22:59
Quote: "Increasing the LED range is just sort of a really bad idea, esp. with the other options in PB."


Well, as I said, it was a work around.


[b]FPSC MIGRATION: http://forum.thegamecreators.com/?m=forum_view&t=142497&b=21
SekoIdiootti
17
Years of Service
User Offline
Joined: 14th Mar 2009
Location: Finland
Posted: 30th Jan 2010 13:23
Hmm, well, umm... So it's kinda hard to do that sorta thing, because I have Fenix Mod, but... Hmm... I just don't understand anything about script stuff.
I'd use EAI's thing... But do I need to put that in the enemy's .fpi file?

Login to post a reply

Server time is: 2026-07-18 05:40:44
Your offset time is: 2026-07-18 05:40:44