BountyHUNTER12 Posted September 12, 2004 Share Posted September 12, 2004 Have you ever wanted to make a module look like it's under attack like the Endar Spire? WELL NOW YOU CAN, with this script created by StormTrooper789! void main() { object oPc=GetFirstPC(); object oRand=GetNearestObject(OBJECT_TYPE_ALL,oPc,1); location lRand=GetLocation(oRand); ApplyEffectAtLocation(0, EffectVisualEffect(3003), lRand, 0.0f); PlayRumblePattern(1); } Now let's explain this junk : object oPc=GetFirstPC() means to find your character in the module. object oRand=GetNearestObject(OBJECT_TYPE_ALL,oPc,1) means to see what objects are near your character that are of any type(sound,placeable,character,door,waypoint, and trigger) location lRand=GetLocation(oRand) This will generate a location for oRand so the explosions can be made. ApplyEffectAtLocation(0,EffectVisualEffect(3003),lRand,0.0f) This will create an explosion at the randoms objects. 3003 means fragmentation grenade effect. PlayRumblePattern(1) This will create a rumble effect around the explosion. Compile the script and your not finished quite yet. We need the script to loop so it wont work only once. Open the *.are file of your module and add the script name without extension to the OnHeartBeat entry. CONGRATULATIONS! Link to comment Share on other sites More sharing options...
Mono_Giganto Posted September 12, 2004 Share Posted September 12, 2004 I like random explosions..... :D:D:D:D:D:D Nice job. And thanks for explaining it. Link to comment Share on other sites More sharing options...
Darth333 Posted September 12, 2004 Share Posted September 12, 2004 This is always fun to play with Link to comment Share on other sites More sharing options...
Darth Dex Posted September 12, 2004 Share Posted September 12, 2004 This is going to be fun! Link to comment Share on other sites More sharing options...
Achilles Posted September 12, 2004 Share Posted September 12, 2004 Definitely need more scripting tutorials. Nice work! Link to comment Share on other sites More sharing options...
RedHawke Posted September 12, 2004 Share Posted September 12, 2004 [insert Evil Gary Oldman as Dracula Laugh here] Very nice StormTrooper789! Link to comment Share on other sites More sharing options...
stingerhs Posted September 13, 2004 Share Posted September 13, 2004 Originally posted by Achilles Definitely need more scripting tutorials. Nice work! i definately agree. for someone that is starting to dabble in scripting, i NEED the tutorials. just so you know, this is one cool script. Link to comment Share on other sites More sharing options...
BountyHUNTER12 Posted September 13, 2004 Author Share Posted September 13, 2004 Thank you everyone. Who thinks this should be added to the 'Do you want to mod Sw:Kotor then start here!' thread? EDIT: Oh wait...I just saw it in that thread. Link to comment Share on other sites More sharing options...
*Yoinked* Posted September 21, 2004 Share Posted September 21, 2004 BOOOOOOOOOOOOOOOOOOOOOOM!!!!!! I like it!Keep it up O Great Scriptmaster:D , You always think of more and more ways to benifit this awsome modding community, and have been somewhat of an inspiration for me, THANKS!! Link to comment Share on other sites More sharing options...
Darth-Meatbag Posted October 16, 2006 Share Posted October 16, 2006 I tip my lightsaber off to you. Thanks for a great script! ^^ ~Darth Meatbag Link to comment Share on other sites More sharing options...
Ali Gelmar Posted October 16, 2006 Share Posted October 16, 2006 I was just wandering could this script be used so if you are lightside and save bastila from the darkside that there random explosion on the next floor. where she is helping the republic. Link to comment Share on other sites More sharing options...
stoffe Posted October 16, 2006 Share Posted October 16, 2006 I tip my lightsaber off to you. Thanks for a great script! You do realise that this is a more than 2 years old thread, which no one has posted in since 2004, and where the thread starter has not visited this forum for over a year? Please refrain from thread necromancy unless you have something pertinent to add to the topic. I was just wandering could this script be used so if you are lightside and save bastila from the darkside that there random explosion on the next floor. where she is helping the republic. Depends on what you want to happen. In general it should work, but if you want to make an explosion to happen within a specific area it's likely much quicker and easier to just create your explosions there, either at specified coordinates or randomly generated coordinates within a specific radius. The script posted by the thread starter generates the explosion at the nearest object. Link to comment Share on other sites More sharing options...
goldberry Posted October 16, 2006 Share Posted October 16, 2006 Well, since the necromancy has started, I'd just like to mention that this script is one that I still use today Link to comment Share on other sites More sharing options...
Mindtwistah Posted May 25, 2007 Share Posted May 25, 2007 Sorry for bringing this old thread up, but is the script for K1? Link to comment Share on other sites More sharing options...
Master Zionosis Posted May 25, 2007 Share Posted May 25, 2007 Sorry for bringing this old thread up, but is the script for K1? I think the reference to the Endar Spire answers your question. But may not apply for it working in K1, but yes the script does work for K1 as all those script functions are in the K1 NwScript. Have you ever wanted to make a module look like it's under attack like the Endar Spire? Link to comment Share on other sites More sharing options...
Mindtwistah Posted May 25, 2007 Share Posted May 25, 2007 Strange.. when I compile, I get this message: Error: Syntax error at "Rand" Leacked PStackEntry (h:\programmieren\vc7\gametools\kotor\nwntools-1.2\nsclib\ns[cannot read further] ccontext.cpp.230) (h:\programmieren\vc7\gametools\kotor\nwntools-1.2\nsclib\ns[cannot read further] cparserroutines.cpp,4272) (h:\programmieren\vc7\gametools\kotor\nwntools-1.2\nsclib\ns[cannot read further] ccontext.cpp.230) (h:\programmieren\vc7\gametools\kotor\nwntools-1.2\nsclib\ns[cannot read further] ccontext.cpp,340) Link to comment Share on other sites More sharing options...
tk102 Posted May 25, 2007 Share Posted May 25, 2007 Stormtrooper789's code had a rogue space in it. Try copy/pasting it again now and see if it compiles for you. Link to comment Share on other sites More sharing options...
Mindtwistah Posted May 26, 2007 Share Posted May 26, 2007 Thanks for fixing it tk. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.