lfnetwork.com mark read register faq members calendar

 12-30-2011, 07:55 PM #1 harIII @harIII Veteran     Join Date: Feb 2008 Posts: 997 Scripting: Is this Possible? I have a really cool idea for part of Yavin in my Shadows of the Empire mod but I'm not sure how to go about doing it. Here's what I need the script to do: 1. Get the location of an NPC in the area (I can do that, the next part is where I get lost) 2. Create three different references for the individual X, Y, and Z coordinates 3. Do this next step five times A - Spawn an invisible placeable at coordinates from the above references at X, Y, and (Z + 3) B - Spawn placeable at (X + 3), Y, and Z C - Spawn placeable at (X - 3), Y, and Z D - Spawn placeable at X, (Y + 3), and Z E - Spawn placeable at X, (Y - 3), and Z This is what I can't figure out, how do I add units to the prerecorded coordinates? Yell at me if this doesn't make sense and you're trying to help. you may: quote & reply,
 12-30-2011, 10:02 PM #2 Fastmaniac @Fastmaniac Rookie     Join Date: Aug 2009 Location: Germany Posts: 164 Well, I can help you with the 3rd step. Assuming you have defined x,y and z-coordinates you can create a loop with a variable i that runs 5 times with spawning the placeables and increasing the variable i by 1. Simplified structure: Code: ```define x = (X-Coordinate); define y = (Y-Coordinate); define z = (Z-Coordinate); define i = 0; function(){ if (i< 5){ (Spawn... change x,y,z; increase i by 1; execute function) else return}}``` Note: It's NOT a finished script. Just an impulse for you I don't have time right now, but if I've confused you more than you already are, just say so and I'll try to reexplain what I mean or look into it tomorrow (depending on whether you want to do it by yourself). I don't know yet how it looks like in the scripting language and since it's not possible to use another language, I'll have to look into it aswell... Fastmaniac you may: quote & reply,
 12-31-2011, 12:56 AM #3 JCarter426 @JCarter426 Senior Member     Join Date: Feb 2008 Location: Look to your left. Posts: 1,668 Something like this should work: Code: ```void main() { vector vector0 = GetPosition(oObject); vector vector1 = Vector(0.0, 0.0, 3.0); vector vector2 = Vector(3.0, 0.0, 0.0); vector vector3 = Vector(-3.0, 0.0, 0.0); vector vector4 = Vector(0.0, 3.0, 0.0); vector vector5 = Vector(0.0, -3.0, 0.0); CreateObject(OBJECT_TYPE_PLACEABLE, Location(vector0 + vector1, 0.0), sTemplate, FALSE); CreateObject(OBJECT_TYPE_PLACEABLE, Location(vector0 + vector2, 0.0), sTemplate, FALSE); CreateObject(OBJECT_TYPE_PLACEABLE, Location(vector0 + vector3, 0.0), sTemplate, FALSE); CreateObject(OBJECT_TYPE_PLACEABLE, Location(vector0 + vector4, 0.0), sTemplate, FALSE); CreateObject(OBJECT_TYPE_PLACEABLE, Location(vector0 + vector5, 0.0), sTemplate, FALSE); }``` Just define oObject and sTemplate - although you may want to create multiple placeables and give them all different tags to keep track of them more easily, in which case you need more than one string. you may: quote & reply,
 12-31-2011, 01:24 PM #4 Fastmaniac @Fastmaniac Rookie     Join Date: Aug 2009 Location: Germany Posts: 164 Yep, that's better than my suggestion... I always think too complex... you may: quote & reply,
01-03-2012, 05:48 PM   #5
harIII
@harIII
Veteran

Join Date: Feb 2008
Posts: 997

Quote:
 Originally Posted by JCarter426 Something like this should work: Code: ```void main() { vector vector0 = GetPosition(oObject); vector vector1 = Vector(0.0, 0.0, 3.0); vector vector2 = Vector(3.0, 0.0, 0.0); vector vector3 = Vector(-3.0, 0.0, 0.0); vector vector4 = Vector(0.0, 3.0, 0.0); vector vector5 = Vector(0.0, -3.0, 0.0); CreateObject(OBJECT_TYPE_PLACEABLE, Location(vector0 + vector1, 0.0), sTemplate, FALSE); CreateObject(OBJECT_TYPE_PLACEABLE, Location(vector0 + vector2, 0.0), sTemplate, FALSE); CreateObject(OBJECT_TYPE_PLACEABLE, Location(vector0 + vector3, 0.0), sTemplate, FALSE); CreateObject(OBJECT_TYPE_PLACEABLE, Location(vector0 + vector4, 0.0), sTemplate, FALSE); CreateObject(OBJECT_TYPE_PLACEABLE, Location(vector0 + vector5, 0.0), sTemplate, FALSE); }``` Just define oObject and sTemplate - although you may want to create multiple placeables and give them all different tags to keep track of them more easily, in which case you need more than one string.
Thanks for throwing this out there I'll give it a try later on tonight.
 LucasForums > Scripting: Is this Possible?

 Thread Tools Display Modes Linear Mode

 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 Rules
 Forum Jump User Control Panel Private Messages Subscriptions Who's Online Search Forums Forums Home -------------------- Network     Star Wars Gamer     Knights of the Old Republic     Mixnmojo.com     Monkey Island Discussion     Brutal Legend Discussion     Grim Fandango Discussion     Psychonauts Discussion at Razputin's Domain     Sam And Max.Net     The Dig Museum     Full Throttle Discussion     IndyJones.net     Fracture     Forum Help & Feedback Center     LucasForums Archive         LEGO Star Wars series         Star Wars         Star Wars: Battlefront series         Star Wars: Classic Gaming         Star Wars: Empire At War         Star Wars: The Force Unleashed series         Star Wars: Galaxies         Star Wars: Jedi Knight series         Star Wars: The Old Republic         Star Wars: Republic Commando         Star Wars: Rogue Squadron series         Star Wars: X-Wing series