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 / Spawn Questions

Author
Message
Leon Kennedy
16
Years of Service
User Offline
Joined: 7th Sep 2008
Location: Neither here nor there
Posted: 6th Mar 2013 18:26
Ok, so I've got something odd that I can't figure out. And I'm hoping someone here can help.

I've got a trigger zone with the following script:



I've got a dynamic entity named Camera1 with the following scipt:



Camera1 Spawn at Start is set to No. When the player enters the trigger zone and presses X, the camera appears. But this is clunky, so I tried to re-write this using a single script in Main for the camera:



When I remove the trigger zone and replace main with the above script, no matter how close I get to where the camera is it doesn't spawn. At all. Anybody know why?

In addition to this, I've got 2 other problems related to the camera (which is the security camera from model pack 2).

1. When I place the camera, unless I am spawning in the above fashion it does not display. It displays in the editor, but not in the test level.

2. According to the script that is normally attached to the camera, it is supposed to have animation (hence, animate=1). But no matter what I try, when the camera spawns it doesn't animate. Is this normal behavior?

I'm not so much concerned about the animation as I am the displaying and spawning issues. Can someone help me understand why I'm having these problems?

Priest of the Church of Joe Wood

In memory of Nanee. 9/1/1993 - 5/16/2009. Rest in Peace, little girl.
BlackFox
FPSC Master
16
Years of Service
User Offline
Joined: 5th May 2008
Location: Knight to Queens Bishop 3
Posted: 6th Mar 2013 20:01
Quote: "When I remove the trigger zone and replace main with the above script, no matter how close I get to where the camera is it doesn't spawn. At all. Anybody know why?"


It will not spawn because you cannot get within 20 units of the camera (if it is mounted to a wall with the default height). The command "plrdistwithin" relates to a central point on the model. It is not 20 units from the camera edge, or it's handle, but the center point of the model. Thus you will not get within 20 units of it unless you are practically standing on it. Other models are different, and all you can do is play with the distances to find the "zone". It is the same with characters. If I script a character to do something if the player gets within 20 units of it, it is not 20 units of the shoe, hand, helmet, or gun. The distance is gauged by the center point of the character model.

The "simplest" method to spawn your camera is to do the following (as you were in the first attempt):

1. Place your camera and assign the name "camera1". Leave the scripts assigned as they are, change the Spawn at Start to "No"

2. Place a trigger and use the following script:



It spawns quite fine for me (at least in my older version), so I fail to understand the point of "this is clunky, so I tried to re-write this using a single script in Main for the camera". The spawn transition is perfect, so perhaps it is something in the engine for those using higher versions.

Quote: "1. When I place the camera, unless I am spawning in the above fashion it does not display. It displays in the editor, but not in the test level."


Camera displays fine for us.

Quote: "2. According to the script that is normally attached to the camera, it is supposed to have animation (hence, animate=1). But no matter what I try, when the camera spawns it doesn't animate. Is this normal behavior?"


Here is a picture of my map layout.



When I first spawn at the player start and press X, the camera spawns for us, but did not move for about 200ms. If I entered the test and came closer before pressing X, the camera spawned and did not start to move for 200ms. It functions normal.


There's no problem that can't be solved without applying a little scripting.
Leon Kennedy
16
Years of Service
User Offline
Joined: 7th Sep 2008
Location: Neither here nor there
Posted: 6th Mar 2013 20:43 Edited at: 6th Mar 2013 20:54
Ok, so my problem then is probably plrdistwithin. The camera isn't at the default height, but that's probably the issue.

The reason I find this "clunky" is because I am going to have 4 separate cameras that need to be spawned, so if I can set them to be activated with a single script that will save on multiple trigger zones and different names for the cameras and all.

I'll test to see how long it takes for the camera to start moving and update.

EDIT: Nope. Camera still doesn't move. Waited about 30 seconds, and it didn't move at all.

EDIT2: Ok, something is really wrong here. I added the condition plrwithinzone=1 to the script in the trigger zone to avoid the player from spawning the camera from anywhere they choose. Unfortunately, it doesn't work. You can press X anywhere in the map and the camera spawns.

Anybody know why this happens? I'm running V1.19...

Priest of the Church of Joe Wood

In memory of Nanee. 9/1/1993 - 5/16/2009. Rest in Peace, little girl.
BlackFox
FPSC Master
16
Years of Service
User Offline
Joined: 5th May 2008
Location: Knight to Queens Bishop 3
Posted: 6th Mar 2013 21:53
Quote: "The reason I find this "clunky" is because I am going to have 4 separate cameras that need to be spawned, so if I can set them to be activated with a single script that will save on multiple trigger zones and different names for the cameras and all."


Actually, if you follow the method I used, you can actually set the script in the trigger to act as a "camera monitor". It can be scripted in a way so the player can activate each camera by using the "settargetname=x" and "activatetarget=1" commands. I can specify "settargetname=camera1", "settargetname=camera2", etc and have my main script activate each one as I press X (or whatever key I assign) to spawn them. Each camera's scripts and properties are identical- just the name changes.

I can spawn the camera via script in the trigger or if the player is within the zone and they can press X to activate it. It works good for me, and since I am still in v1.17, I am afraid I cannot help pinpoint your exact issue. Sorry if I was of no help.


There's no problem that can't be solved without applying a little scripting.
Leon Kennedy
16
Years of Service
User Offline
Joined: 7th Sep 2008
Location: Neither here nor there
Posted: 6th Mar 2013 23:02
It's all good, BF.

I updated to v1.20.016, and I am still experiencing all of these issues. Not to mention that now FPSC is sluggish as hell. Looks like a full uninstall/reinstall is in order.

Sigh.

Priest of the Church of Joe Wood

In memory of Nanee. 9/1/1993 - 5/16/2009. Rest in Peace, little girl.
Leon Kennedy
16
Years of Service
User Offline
Joined: 7th Sep 2008
Location: Neither here nor there
Posted: 7th Mar 2013 00:51
Well, uninstall/reinstall did NOT alleviate the problem. I'm going to remove the cameras and re-add them and see if that works. If that doesn't do it, I'll build the level from scratch (it's not that big to begin with) and see if that helps.

Priest of the Church of Joe Wood

In memory of Nanee. 9/1/1993 - 5/16/2009. Rest in Peace, little girl.
Leon Kennedy
16
Years of Service
User Offline
Joined: 7th Sep 2008
Location: Neither here nor there
Posted: 7th Mar 2013 16:51
I have determined that this is an issue with the map itself. I can drop the camera into other maps and it animates fine; I can use the trigger zone and it works fine.

Damn.

Well, I've got some work to do in recreating this map now.

Damn.

Priest of the Church of Joe Wood

In memory of Nanee. 9/1/1993 - 5/16/2009. Rest in Peace, little girl.
Leon Kennedy
16
Years of Service
User Offline
Joined: 7th Sep 2008
Location: Neither here nor there
Posted: 7th Mar 2013 17:29
Issue still persists. Taking this to FPSC Chat as the issue is not truly spawning.

Priest of the Church of Joe Wood

In memory of Nanee. 9/1/1993 - 5/16/2009. Rest in Peace, little girl.
Meows
13
Years of Service
User Offline
Joined: 12th Oct 2011
Location: Totally over the Rainbow
Posted: 9th Mar 2013 19:58
I just tried this sample and it worked great. Used NorthernFox code, camera spawns and pans after a short delay for the signal to reach it.

Login to post a reply

Server time is: 2024-11-23 16:55:47
Your offset time is: 2024-11-23 16:55:47