Aller au contenu

Photo

How to Swap/Hide/Show Placeables?


  • Veuillez vous connecter pour répondre
8 réponses à ce sujet

#1
ColorsFade

ColorsFade
  • Members
  • 1 267 messages
 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!

#2
Lugaid of the Red Stripes

Lugaid of the Red Stripes
  • Members
  • 955 messages
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?

#3
rjshae

rjshae
  • Members
  • 4 494 messages

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
ColorsFade

ColorsFade
  • Members
  • 1 267 messages

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 :) It 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!

#5
kamal_

kamal_
  • Members
  • 5 252 messages

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 here :) It 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!

The NWN toolsets are like zombo.com. You can do anything at zombo.com. ;)

#6
ColorsFade

ColorsFade
  • Members
  • 1 267 messages
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.

#7
Tchos

Tchos
  • Members
  • 5 055 messages
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
Morbane

Morbane
  • Members
  • 1 883 messages
also - a door-type gate can be scaled if need be

#9
Shaughn78

Shaughn78
  • Members
  • 637 messages
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.