I have a scenario: I need to show a gate in two states: open and closed. I need the gate to be closed for the first part of a mod, and then open for the rest. There are two gate placeables (rural fort) for this: open and closed. What I can't figure out is how to swap them.
I see that SLS2 appears to swap placeables for lamp posts, etc., when you are using two-state lights. But the scripts are compiled and I can't get at the code to see what he's doing.
How can I do this? I know there has to be a way.
Thanks!
How to Swap/Hide/Show Placeables?
Débuté par
ColorsFade
, mars 15 2013 02:59
#1
Posté 15 mars 2013 - 02:59
#2
Posté 15 mars 2013 - 03:14
Depending on the situation, you could just destroy the gate placeable, and then spawn in (CreateObject) a new one.
I'd paint down a waypoint to keep the exact location (paint down the second placeable in the toolset as you want it to appear, then copy and paste the location and orientation to the waypoint, and then delete the original).
You'll probably have to set up a custom blueprint as well for the new gate, to get all the settings right.
For the sake of the walkmesh, set the original gate (closed) to walkable, with dynamic collisions set to true, and non-static.
But why not just use a door?
I'd paint down a waypoint to keep the exact location (paint down the second placeable in the toolset as you want it to appear, then copy and paste the location and orientation to the waypoint, and then delete the original).
You'll probably have to set up a custom blueprint as well for the new gate, to get all the settings right.
For the sake of the walkmesh, set the original gate (closed) to walkable, with dynamic collisions set to true, and non-static.
But why not just use a door?
#3
Posté 15 mars 2013 - 03:23
Lugaid of the Red Stripes wrote...
I'd paint down a waypoint to keep the exact location (paint down the second placeable in the toolset as you want it to appear, then copy and paste the location and orientation to the waypoint, and then delete the original).
I also like to copy/paste the orientation data in the Waypoint's Comments field in case I accidently nudge it later (with the position locked, of course).
Modifié par rjshae, 15 mars 2013 - 04:52 .
#4
Posté 15 mars 2013 - 03:36
Lugaid of the Red Stripes wrote...
But why not just use a door?
Trust me, a door would not work here; wouldn't make sense here
I didn't know I could spawn a placeable. I knew I could destroy one though. My plan with the closed gate was just as you said: make it walkable and turn on dynamic collision. I just didn't know how to get the second gate - the open one - in there. The waypoint makes perfect sense.
Thanks!
#5
Posté 15 mars 2013 - 03:40
The NWN toolsets are like zombo.com. You can do anything at zombo.com.ColorsFade wrote...
Lugaid of the Red Stripes wrote...
But why not just use a door?
Trust me, a door would not work here; wouldn't make sense hereIt has to be a gate.
I didn't know I could spawn a placeable. I knew I could destroy one though. My plan with the closed gate was just as you said: make it walkable and turn on dynamic collision. I just didn't know how to get the second gate - the open one - in there. The waypoint makes perfect sense.
Thanks!
#6
Posté 15 mars 2013 - 03:55
Well, it worked perfectly! Thank you Lugaid.
Door blueprint, waypoint, destroy, spawn. Done. Easy. Really pleased. The closed gate keeps the character out, the open gate lets 'em through.
Door blueprint, waypoint, destroy, spawn. Done. Easy. Really pleased. The closed gate keeps the character out, the open gate lets 'em through.
#7
Posté 16 mars 2013 - 11:22
I believe Lugaid meant why not use one of the door-type objects that have gate appearances? They're already designed to block movement until they're opened, and they can be opened or closed (animated) by script.
#8
Posté 17 mars 2013 - 09:09
also - a door-type gate can be scaled if need be
#9
Posté 17 mars 2013 - 11:37
One thing I have done with appearing & disappearing placeables is this:
I add everything in the toolset. This allows a little more tine tuning than a waypoint.
An on client enter script will run, the first time a player enters the area the placeables are identified and each one has their location added to the area local locations. The client enter script or other scripts can then create and destroy them based whatever you set.
This is how I created a my blacksmith that had a sword placeable appear on the anvil while he hammered, in a cooling tub and in the coals.
I add everything in the toolset. This allows a little more tine tuning than a waypoint.
An on client enter script will run, the first time a player enters the area the placeables are identified and each one has their location added to the area local locations. The client enter script or other scripts can then create and destroy them based whatever you set.
This is how I created a my blacksmith that had a sword placeable appear on the anvil while he hammered, in a cooling tub and in the coals.





Retour en haut






