lfnetwork.com mark read register faq members calendar

Thread: Placeables Script
Thread Tools Display Modes
Post a new thread. Add a reply to this thread. Indicate all threads in this forum as read. Subscribe to this forum. RSS feed: this forum RSS feed: all forums
Old 04-22-2013, 09:35 PM   #1
Hunters Run
Rookie
 
Hunters Run's Avatar
 
Join Date: Jun 2009
Location: the same place as gnus
Posts: 117
Current Game: Assassins creed
Placeables Script

If I wanted to destroy a placeable and replace it with another in the exact same spot how would I go about doing it?


It's just like chicken-only different.
Hunters Run is offline   you may: quote & reply,
Old 04-22-2013, 09:50 PM   #2
Fallen Guardian
Wandering the Galaxy...
 
Fallen Guardian's Avatar
 
Join Date: Aug 2010
Location: Unknown Regions
Posts: 1,286
Current Game: Knights of the Old Republic
Veteran Modder Helpful! 
You'd have code that looks something like this:

Code:
void main()
{

   object oOrigPlac = GetObjectByTag("TAG OF PLACEABLE"); //This is your original placeable, the one you're destroying. 

   location lOPlac = GetLocation(oOrigPlac); //This is the location of that original placeable.

      DestroyObject(oOrigPlac); //Destroys the original placeable.

      CreateObject(OBJECT_TYPE_PLACEABLE, "TEMPLATE RES REF OF NEW PLACEABLE", lOPlac); //Creates the new placeable where the old one was.

}
Now that's assuming you don't have the original placeable's coordinates in the beginning. In all honesty it'd be best to just have the original placeable's coordinates, to reduce glitches/weird things going on that might occur with trying to grab the original placeable's location and use it to spawn the new one when the original has been destroyed. So, if you had the coordinates, the script would look like this:

Code:
void main()
{

   object oOrigPlac = GetObjectByTag("TAG OF PLACEABLE");

   vector PlacPosition = Vector(333.33, 333.33, 333.33);
   location lOPlac = Location(PlacPosition, 234.44);

      DestroyObject(oOrigPlac);

      CreateObject(OBJECT_TYPE_PLACEABLE, "TEMPLATE RES REF OF NEW PLACEABLE", lOPlac);

}
The green 333.33 triplets are the place where your X, Y and Z coordinates of the placeable would go. The red 234.44 is the angle orientation of that placeable.


The truly fallen cannot return to the light. If someone "falls" and "returns," they never really, truly fell.

Current Work in Progress: Dantooine Tension

Released Works
Blaster Pistol Enhancement
Dustil Restoration
Ebon Hawk Texture Enhancement
Gaffi Stick Improvement
Weapon Model Overhaul Texture Rework (Thanks to Toasty Fresh!)
Sunry Murder Recording Enhancement
VP's Hi Poly Tin Cans - KotOR 1 Version
Fallen Guardian is offline   you may: quote & reply,
Old 04-23-2013, 08:01 PM   #3
Hassat Hunter
Forumite
 
Join Date: Jan 2010
Posts: 557
Or if it gets spawned on a waypoint, just usse it's tag.

Just a note of warning, destroying items and placing them at the same time will mess up the location. The destroyed one still "resides" so the new isn't in the exact same spot but slightly pushed aside to a 'free' position.

So you'll have to delay the spawn. DelayCommand or ActionWait wont work, so there's;
1) Using a delayed ActionPauseConversation (only in conversations)
2) Delaying another script being triggered which adds the new placeable.

Good luck!
Hassat Hunter is offline   you may: quote & reply,
Post a new thread. Add a reply to this thread. Indicate all threads in this forum as read. Subscribe to this forum. RSS feed: this forum RSS feed: all forums
Go Back   LucasForums > Network > Knights of the Old Republic > Editing / Modding > Holowan Laboratories > Placeables Script

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 02:30 PM.

LFNetwork, LLC ©2002-2011 - All rights reserved.
Powered by vBulletin®
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.