Faulty Trigger/Script

Post » Tue Apr 27, 2010 7:02 am

I've placed a trigger (http://img3.imageshack.us/img3/6268/2010060.jpg) in the supply room behind the Vault 101 entrance. To create the trigger, I took the trigger that causes the radroaches to appear in Butch's room ("CG04ButchTriggerWall"), copied it, and created a new form ("CG04HannonEnterTrigger"). I created a script, and selected it in the menu for the trigger (http://img522.imageshack.us/img522/8548/2010061.jpg). To create the script, I took a script that had no users (I don't remember the original name), replaced its text with the text of the script from the Taft Tunnels that triggered the ghoul attack on the brotherhood checkpoint ("MQ05TaftCheckpointAttackSCRIPT"), and altered the conditional statements and result statements. The script (http://img52.imageshack.us/img52/5131/2010062.jpg) is supposed to summon security chief Hannon ("CG04Vault101Security01REF") to a certain XMarkerHeading ("XMarkerHeadingVault101a01") if he is still alive ("if GetDead CG04Vault101Security01REF == 0"). (If I can get it to work as is, I will also add a condition checking which cell he is already in before performing the move, so that he is not teleported from place to place within the same cell.) When tested ingame, during the quest Escape ("CG04"), and with Hannon left alive before running through the trigger, either my trigger or my script is faulty; nothing happens. Anybody have any idea which is faulty, why it might be, or what to do differently?

My only guess is that, because Butch's trigger has been (and had to have been) triggered before mine, it somehow registered that mine had already been triggered. But when I switched it to being a copy of a different trigger, one that had a world count of zero, it still failed to perform the result commands. Is it my script then?
User avatar
Jordan Fletcher
 
Posts: 3355
Joined: Tue Oct 16, 2007 5:27 am

Post » Tue Apr 27, 2010 12:30 pm

Hmm. It took me a while to decipher all that, but the image of the script and trigger looks ok, Maybe add a line right at the beginning of the OnTriggerEnter Player block to dsiplay a message so you'll know if the script is fireing or not. I looked at the original trigger to see if the primitive was something funky, but it was ok too.
User avatar
Emma Pennington
 
Posts: 3346
Joined: Tue Oct 17, 2006 8:41 am

Post » Tue Apr 27, 2010 1:03 am

Hmm. It took me a while to decipher all that, but the image of the script and trigger looks ok, Maybe add a line right at the beginning of the OnTriggerEnter Player block to dsiplay a message so you'll know if the script is fireing or not. I looked at the original trigger to see if the primitive was something funky, but it was ok too.


On the wiki, in the article "OnTriggerEnter", it has a note saying that if a trigger zone is too thin, a player can pass through it without triggering it. I think that might be what is happening. The trigger appears in the GECK as being substanceless, the only indication of its presence being the green frame and the letter P. Most trigger zones appear as pink or green boxes. So I think the issue is that its shape needs to be changed. I know it can be done, since I see trigger zones of different dimensions and proportions all the time. I just don't know *how* to do it. Does anybody here?
User avatar
Naomi Ward
 
Posts: 3450
Joined: Fri Jul 14, 2006 8:37 pm

Post » Tue Apr 27, 2010 9:34 am

The thing is I've personally used triggers. but, I always made a brand-new one if it was intended as an independent function. If you copied and pasted an existing one into the GECK, I know that it would act like just one of two of the same trigger. So having never done it this way, but having made bunches of working triggers and in fact made and used copies of my own trigger... I am not sure what to suggest.
User avatar
Noely Ulloa
 
Posts: 3596
Joined: Tue Jul 04, 2006 1:33 am

Post » Tue Apr 27, 2010 4:47 pm

The thing is I've personally used triggers. but, I always made a brand-new one if it was intended as an independent function. If you copied and pasted an existing one into the GECK, I know that it would act like just one of two of the same trigger. So having never done it this way, but having made bunches of working triggers and in fact made and used copies of my own trigger... I am not sure what to suggest.


But I gave it a new ID and everything. It appears in the object window as a separate form. Shouldn't it act as a new trigger on its own? Or is there data that doesn't appear in the regular edit window, that can only be changed during creation? How *do* you create a new trigger, anyway?
User avatar
Laura Simmonds
 
Posts: 3435
Joined: Wed Aug 16, 2006 10:27 pm

Post » Tue Apr 27, 2010 9:38 am

On the GECK tool bar there is a cube with a letter "T" in it. Click it to make a new trigger. Then move your mouse onto some surface in the render window and leftt-click-drag-release to make the horizontal axis, then repeat to make the vertical. When you are done, you should see a pink box. If you click on the box, you will see 3 "Gizmos" one for each axis in 3-D (Blue, Red & Green). If you click and drag the gizmo arrows, you can resize the cube. If you click and drag elsewhere you can move the whole cube.
User avatar
jeremey wisor
 
Posts: 3458
Joined: Mon Oct 22, 2007 5:30 pm

Post » Tue Apr 27, 2010 4:47 pm

On the GECK tool bar there is a cube with a letter "T" in it. Click it to make a new trigger. Then move your mouse onto some surface in the render window and leftt-click-drag-release to make the horizontal axis, then repeat to make the vertical. When you are done, you should see a pink box. If you click on the box, you will see 3 "Gizmos" one for each axis in 3-D (Blue, Red & Green). If you click and drag the gizmo arrows, you can resize the cube. If you click and drag elsewhere you can move the whole cube.


Holy christ. o.O This is the most useful thing I have ever learned about the GECK. I cannot begin to thank you enough.

HOWEVER, upon creating a new trigger box and attaching my script to it, it still doesn't work when tested out. At this point I'm almost certain it's something wrong with the script. I'll post it in text form here.

ScriptName CG04HannonEnterTriggerSCRIPT

short doOnce

begin onTriggerEnter player

if GetQuestRunning CG04 == 1 && doOnce == 0
if GetDead CG04Vault101Security01REF == 0
CG04Vault101Security01REF.moveto XMarkerHeadingVault101a01
set doOnce to 1
endif
endif

end


There must be something I've done wrong here.

... Wait....

:(
Okay, so I checked in the object window, and Hannon is listed as "CG04Vault101Security01", not "CG04Vault101Security01REF." However, when I double-clicked on him before to *check* his ID, the "-REF" ending *was* present. Furthermore, when I try to remove the "-REF" ending from the script, it says it's invalid and refuses to save it. So even if his actual ID, for use in scripts, does *not* have a "-REF" on it, it won't let me use it.

EDIT: So, it let me use the ID *without* the "-REF" in the condition line ("if GetDead CG04Vault101Security01 == 0"), but it refuses to let me save the script if the "-REF" is missing from the command line ("CG04Vault101Security01REF.moveto XMarkerHeadingVault101a01"). Either way, though, it still doesn't work when tested out.

EDIT II: Actually, the ID without the "-REF" ending is his *base form* ID, whereas the ID *with* it is his specific reference ID. So I guess I have to include the "-REF". So I'm not thinking that's the issue anymore. What could it be?!
User avatar
Alexx Peace
 
Posts: 3432
Joined: Thu Jul 20, 2006 5:55 pm

Post » Tue Apr 27, 2010 8:32 am

I personally use the pre-made triggers found in /data/meshes/triggers/. You have a 'wall' and a 'box' object which I scale to fit the sizes I need.

When you are unsure of your scripts, use the wiki and you may find your answers.

Anytime you use a function call on a referenced actor, you MUST prefix it with the '.' period.
Your GetDead does not have this period. And you put the reference name 'after' the function.
Look it up here: http://geck.gamesas.com/index.php/GetDead
I also took the liberty of re-writing your IF logic.

if doOnce == 0   if GetQuestRunning CG04 == 1	  if CG04Vault101Security01REF.GetDead == 0		 CG04Vault101Security01REF.moveto XMarkerHeadingVault101a01		 set doOnce to 1	  endif   endifendif

User avatar
Dona BlackHeart
 
Posts: 3405
Joined: Fri Dec 22, 2006 4:05 pm

Post » Tue Apr 27, 2010 1:33 pm

I personally use the pre-made triggers found in /data/meshes/triggers/. You have a 'wall' and a 'box' object which I scale to fit the sizes I need.

When you are unsure of your scripts, use the wiki and you may find your answers.

Anytime you use a function call on a referenced actor, you MUST prefix it with the '.' period.
Your GetDead does not have this period. And you put the reference name 'after' the function.
Look it up here: http://geck.gamesas.com/index.php/GetDead
I also took the liberty of re-writing your IF logic.

if doOnce == 0   if GetQuestRunning CG04 == 1	  if CG04Vault101Security01REF.GetDead == 0		 CG04Vault101Security01REF.moveto XMarkerHeadingVault101a01		 set doOnce to 1	  endif   endifendif


I can't remember why I originally had it written like I did (I know there was a reason), but you're definitely right. Upon changing it to that, it now works perfectly. I'd be 100 times more grateful if I weren't dead-ass tired from being up all night, but I hope you'll accept my thanks as they are.
User avatar
Roddy
 
Posts: 3564
Joined: Fri Jun 15, 2007 11:50 pm

Post » Tue Apr 27, 2010 2:05 am

I can't remember why I originally had it written like I did (I know there was a reason), but you're definitely right. Upon changing it to that, it now works perfectly. I'd be 100 times more grateful if I weren't dead-ass tired from being up all night, but I hope you'll accept my thanks as they are.

Hmmm, I can't think of any reason.
Enjoy the code and get some sleep. :)

The reason for making the first If condition seperate is, when this is done, I dont want it checking the quest stage every single frame.
User avatar
amhain
 
Posts: 3506
Joined: Sun Jan 07, 2007 12:31 pm

Post » Tue Apr 27, 2010 2:51 am

Good call, WillieSea. I looked at that script 10 times and never noticed the misaligned getdead. Guess I was pretty tired myself...
User avatar
Oceavision
 
Posts: 3414
Joined: Thu May 03, 2007 10:52 am


Return to Fallout 3