Krypt on 13/3/2005 at 06:16
Quote Posted by ascottk
For example, trigger scripts: I know why trigger scripts are used but I can't get them to work. I'd like to have something happen after an AI walks through a patrol point. More specific: A keeper walks through a patrol point that opens a door. I know when your select a script from the browser and right-click an actor, you can add the script to that actor. Then what? How is that trigger script actually triggered? Links (keeper, patrol point, door)? TriggerLink name? Link-creator?
A visual representation of trigger scripts would be helpful.
Triggerscripts can be triggered any number of ways. There are lots of conditions, and every one listens for something different. Here is how I would set up this specific script you're trying to create:
1. Create a new triggerscript with condition "When AI reaches a patrolpoint linked by TriggerScript link [String]" and then enter whatever you want to use to identify this link in the string field, it doesn't really matter what you put. Then add an action, "Open any doors on linked object [LinkFlavor]" Put in AssociationLink under LinkFlavor. Click OK to save your script.
2. Now, go to your Keeper guy you want to use for your scripted event. Go to the scripts section in his properties and add your script.
3. Go into Create Links mode by pushing the button on the left toolbar that looks like 2 red circles with an arrow pointing from one to the other. Select TriggerScript in the list of link flavors. Now add a TriggerScript link from your Keeper to the PatrolPoint. Then right click the Keeper and go to Actor Links and open the properties for the TriggerScript link you just added. Go to TriggerLink>LinkName and enter whatever you put in the [String] in your trigger condition. Click Done a couple times and you've now successfully set up the TriggerLink you need for this script.
4. Now click the Create Links button again and go down to Association. Create an AssociationLink from your Keeper to the door you want to open. It actually doesn't have to be an Association link specifically, you can put any type of link in your script. I always used Association as a secondary type of link for scripting because it doesn't do anything that I know of. Just don't use a link that has some other function (RigidAttachment, HingedAttachment, etc.) because it can cause weird things to happen. You're done now, the door should open when the Keeper reaches that point in his patrol path.
The wording of the trigger conditions/actions you use should tell you how you need to set things up. In this case the condition "When AI reaches a patrolpoint linked by TriggerScript link [String]" tells you that the script needs to be placed on the AI and the link has to go from the AI to the PatrolPoint. Similarly, when you have an action that references a linked object, that also means the link needs to be from the object with the script on it.
Quote Posted by ascottk
Another example: Null has a tutorial on early performance tips (extremely helpful BTW). Double-portals so the game only renders what's physically seen. Does that mean a room that's around the corner isn't rendered yet until you are actually there (or within the player's sight-line)? How?
Double portals means when you create a doorway with a cube subtraction, you want to put a portal on both sides of the door. The portaling system divides the game world into chunks based on how the map is portaled, and the location of the portals relative to the player's view determines which "chunks" will be rendered. In this case, if you were around the corner from the door, you would be able to see the portal on the side of the door closest to you, but not the one on the other side. Nothing on the other side of that door would be rendered. To actually create a portal, just add a nonsolid sheet brush to your map. Click the create sheet button to change your builder brush to a sheet, then go to Add Special Brush and select Zone Portal in the drop down list and hit OK. I always just make one and then copy/paste and resize after that so I don't have to go through that whole process for every portal.
Quote Posted by ascottk
What about tags? Flags? Ints? Movers? Clipping brushes (saw that one in a forum somewhere)?
Not sure what "tags" you're asking about, so I'll skip that one :p Flags and Ints are global variables you can use for various scripting purposes. An example use of a flag is when you overhear a conversation between two NPCs, a flag ThisConversationHasPlayed is set to true. This tells the game not to play the conversation again. Flags are the way you track events in the game for your scripts, so you'll probably be using them pretty frequently if you're planning on doing any amount of scripting. Ints are just a global integer you can use to keep track of numbers. An example of this from the original game is the sta_gameday globalint that keeps track of which day you're currently on in the game. So how do you look at the Flags and Ints? View>Global Variables>Flags and Ints. These bring up lists of all the Flags and Ints, and allow you to add your own.
As for brush clipping, read my post (
http://www.ttlg.com/forums/showthread.php?t=94433) here
Hopefully all that makes sense :eek: Let me know if there's any points I glossed over that you'd like elaboration on.