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 / Entitys using trigger zones

Author
Message
Nilloc
15
Years of Service
User Offline
Joined: 14th Nov 2009
Location:
Posted: 20th Mar 2010 01:01
is their such a script where a ally or enemy walk into a trigger zone to open a door ive looked in the script bank but cant fin one
Bugsy
16
Years of Service
User Offline
Joined: 24th Nov 2008
Location: another place in time
Posted: 20th Mar 2010 06:19
write one using the "anywithinzone" command. it won't be able to discern whether it's a friend or foe (or barrel for that matter) but it will open a door when a dynamic entity steps into a zone. great for portal style super colliding super buttons that need weighted cubes on them to keep a door open.


Nilloc
15
Years of Service
User Offline
Joined: 14th Nov 2009
Location:
Posted: 20th Mar 2010 08:02
i dont know one thing about scripting could you help me?
MarkSA
15
Years of Service
User Offline
Joined: 13th Mar 2009
Location: DownUnder
Posted: 20th Mar 2010 09:43
I wish I could be of help, as I am trying to do the same thing.
I made this request over a month ago and though I got some sort of answer, it didn't solve my problem.

It is a bit hard if you don't know much about scripting and there is not enough help to point one in the right direction.

I am getting the impression that there is some reluctance to help.
ctm
19
Years of Service
User Offline
Joined: 25th Feb 2005
Location:
Posted: 20th Mar 2010 11:46
I have tested the zoneanyactivate script with a triggerzone and realised that it does not work as intended.

The condition anywithinzone=1 does not become true when:

- a NPC walks into the zone
- Player throws a physics entity into the zone

The only 2 things that work is when the player carrys a physics entity like a box and enters or leaves the zone or picks up a entity which is in the zone.
Nilloc
15
Years of Service
User Offline
Joined: 14th Nov 2009
Location:
Posted: 20th Mar 2010 18:16
Exactly

[quote]I have tested the zoneanyactivate script with a triggerzone and realised that it does not work as intended.

The condition anywithinzone=1 does not become true when:

- a NPC walks into the zone
- Player throws a physics entity into the zone

The only 2 things that work is when the player carrys a physics entity like a box and enters or leaves the zone or picks up a entity which is in the zone.
Snipesoul
17
Years of Service
User Offline
Joined: 29th Aug 2007
Location: Somewhere in New York...
Posted: 20th Mar 2010 19:35
We need an entitywithinzone command... or maybe a targetwithinzone command to use along with settargetname=x.

That way, we can create a character named NPC for example, set the door's targetname to NPC and use this targetwithinzone command.

There are so many useful commands FPSC needs...

"Dad? Dad, I'm a- Ye- Not a "crazed gunman", dad, I'm an assassin! ...Well, the difference bein' one is a job and the other's mental sickness!" - The Sniper.
Nilloc
15
Years of Service
User Offline
Joined: 14th Nov 2009
Location:
Posted: 20th Mar 2010 19:37
exactly snipesoul but who can code it to do that no one seems to know that ive talked to
ctm
19
Years of Service
User Offline
Joined: 25th Feb 2005
Location:
Posted: 20th Mar 2010 21:54
Good news:

i made some more tests and found the problem.

It's not the scriptcondition...it's the triggerzone.
By default it's set to high to detect thrown barrels or NPCs. (i noticed that when i threw a barrel to the ceiling)

Just lower the Zonecube to the ground and it works.
Nilloc
15
Years of Service
User Offline
Joined: 14th Nov 2009
Location:
Posted: 20th Mar 2010 22:40
so lower it below the ground?
MarkSA
15
Years of Service
User Offline
Joined: 13th Mar 2009
Location: DownUnder
Posted: 21st Mar 2010 02:00
ctm,

Could you give instructions on how you got it working?

I lowered the triggerzone to floor. The door was opened even before an NPC entered the triggerzone.
Nilloc
15
Years of Service
User Offline
Joined: 14th Nov 2009
Location:
Posted: 21st Mar 2010 03:39
same
ctm
19
Years of Service
User Offline
Joined: 25th Feb 2005
Location:
Posted: 21st Mar 2010 09:56 Edited at: 21st Mar 2010 10:39
The cube has to touch the ground to detect the NPC.

The unlogical fact is that a switch or a other nonstatic entity which is not inside the zonecube nevertheless
activates the zone.

There may be no other non static entities inside the 100x100 area.

EDIT:
A door is a dynamic entity.
Placing the triggerzone in front of a door will activate it immediatly.
Placeing the triggerzone beside the door works.

I attached a screenshot of my testlevel.

Attachments

Login to view attachments
Nilloc
15
Years of Service
User Offline
Joined: 14th Nov 2009
Location:
Posted: 21st Mar 2010 18:27
kk the door come make some major problems but ill find a way
MarkSA
15
Years of Service
User Offline
Joined: 13th Mar 2009
Location: DownUnder
Posted: 22nd Mar 2010 04:12
ctm,

Thanks.

How about step by step instructions on how you did it.

Is the door remote or auto?

What scripts for the door, trigger zone and NPC?
ctm
19
Years of Service
User Offline
Joined: 25th Feb 2005
Location:
Posted: 22nd Mar 2010 14:22 Edited at: 22nd Mar 2010 20:17
[Edit]Made some more tests:
You can place a triggerzone with the zoneanyactivate script in front of a door.
You just have to move the zonecube a bit away from the door by using the arrowkeys.
When you lower the zonecube to the floor the NPC will get stuck inside if there is no waypoint inside the zone
[/Edit]

ok, lets start with the Door:

You'll need a remote door.
The only thing you have to do here is to give the "Remote Door" a unique name...something like "mydoor01".

The Triggerzone:

The triggerzones default Main script is "plrinzone.fpi". Change it to the "zoneanyactivate.fpi".

Type the name of the door into the IF USED field of the triggerzone. here: mydoor01

And lower the zone to the ground by using the page down key. (see the attached screenshot)
When the mousecurser is pointing at the zonecube you can move the camera easy to a sideview by holding the right mousebutton and moving the mouse.

Waypoints:
Only a overview:
- create new waypoint by clicking the "Create New Waypoint" button.
- leftclick and hold left mousebutton to move the waypoint
- shift+leftclick to add a waypoint
- shift+rightclick to remove a waypoint
- go to any other mode and use space button to hide waypoints

The NPC:

For a test you can use any person script that lets the NPC follow waypoints: i.e. coward.fpi, follow.fpi, or medicheal.fpi

Hope that helps

Attachments

Login to view attachments
MarkSA
15
Years of Service
User Offline
Joined: 13th Mar 2009
Location: DownUnder
Posted: 23rd Mar 2010 03:21 Edited at: 24th Mar 2010 01:46
cmt,

I made a test map following your instructions and it worked.

I then looked at the map I am having trouble with, took a look at what I had done and it didn't work, even with your instructions. I had the same scripts etc in my map.

Just to see what would happen, I moved the NPC, waypoint and triggerzone away from the nearest static entity.

Well, it worked, I got the closed door I wanted to be opened by the NPC, opened. This door originally wasn't a remote door, so I used the door remote script.

It seems some things don't work too well near enitities.

Many thanks for your help, you have pointed me in the right direction.
ctm
19
Years of Service
User Offline
Joined: 25th Feb 2005
Location:
Posted: 23rd Mar 2010 12:22 Edited at: 24th Mar 2010 02:21
you're welcome

btw: here is a script which lets a npc open a door for the player:

http://forum.thegamecreators.com/?m=forum_view&t=167719&b=23&p=0
MarkSA
15
Years of Service
User Offline
Joined: 13th Mar 2009
Location: DownUnder
Posted: 24th Mar 2010 01:48
ctm,

Your scripts look great. At some stage I will have give them a try.

Login to post a reply

Server time is: 2024-11-25 02:10:15
Your offset time is: 2024-11-25 02:10:15