Aller au contenu

Photo

leaver script to swap out placeables


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

#1
Tonden_Ockay

Tonden_Ockay
  • Members
  • 538 messages

Hi

 

I'm using Project Q and it has two city gates one with the gate up and one with the gate down. I would like to have a script that would destroy one and spawn the other in its place. The idea is when ever the leave is switched that the placeables would swap out making it look as the city gate is oping and closing.

 

I was going to try and use NWN Script Generator LS-TK

/* 
 *  Script generated by LS Script Generator, v.TK.0
 *
 *  For download info, please visit:
 *  http://nwvault.ign.com/View.php?view=Other.Detail&id=1502
 */
// Put this script OnUsed.


void main()
{
    object oTarget;
    object oSpawn;

    // Get the creature who triggered this event.
    object oPC = GetLastUsedBy();

    // Destroy an object (not fully effective until this script ends).
    DestroyObject(GetObjectByTag("Gateup001"));

    // Spawn "gatedown001".
    oTarget = GetWaypointByTag("city gate");
    oSpawn = CreateObject(OBJECT_TYPE_PLACEABLE, "gatedown001", GetLocation(oTarget));
}

but as you can tell I soon realized that the script I wanted to make was a little advanced for the script generator.

 

I was reading on the net that I would need to put two versions of the placeable at the same location (copy/paste the coordinates from one to the other to be sure) and set one as static, the other as not static.

 

Is there already a script on the web that I could use? If so could someone point it out to me?



#2
kamal_

kamal_
  • Members
  • 5 238 messages

Hi Tonden. You want the nwn1 forums: http://forum.bioware...rwinter-nights/

 

This is the nwn2 forums.



#3
Tchos

Tchos
  • Members
  • 5 030 messages

I was reading on the net that I would need to put two versions of the placeable at the same location (copy/paste the coordinates from one to the other to be sure) and set one as static, the other as not static.

 
Still, since it's here in the NWN2 forum, I can say that though I don't know if this is the case in NWN1, I can say for certain that in NWN2 you would not, and should not, place two versions of the placeable (static and non) in the same location for this purpose. 

 

In fact, you can destroy a static placeable just as easily as a non-static one, and replace it with any other placeable, but you can only see the destruction of a static placeable after an area load.  Thus I prefer to destroy static placeables when the player is in a different area, so that when they go to the area with the placeable, it's already gone. 

 

But for this purpose you would not use a static placeable at all.  You would use a single non-static placeable, with the "Usable" property disabled so that it doesn't highlight when the player hovers over it.  Destroying such a placeable would be visible immediately, and you can replace it with your new one.



#4
4760

4760
  • Members
  • 1 204 messages

What about making one placeable very small (invisible then) and the other at the 1,1,1 scale, and change the scaling to 1,1,1 for the invisible one and 0.01,0.01,0.01 (or less, depending on the actual size) for the previously visible one? No need to reload the area then, and if you add some delays in a loop (from 0.01,0.01,0.01 to 1,1,1) you could also fake the closing and opening too.



#5
Tchos

Tchos
  • Members
  • 5 030 messages

I would expect that scale changes would not be immediately visible on a static placeable either, if they work at all.  With a non-static placeable, area reloading is not necessary, so there's no need to work around it as long as the placeable is non-static.



#6
kamal_

kamal_
  • Members
  • 5 238 messages

He's asking about nwn1, where you can't scale stuff.