lfnetwork.com mark read register faq members calendar

Thread: Random Explosions Tutorial
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 09-12-2004, 05:52 PM   #1
StormTrooper789
Junior Member
 
StormTrooper789's Avatar
 
Join Date: Jun 2004
Location: Millington,TN
Posts: 258
Post Random Explosions Tutorial

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!
Code:
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),l Rand,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!


I scored 12.03156% on the Geek Test.
What about you?

Official Internet Exploiter hater!

Did you know Microsoft wants to "Assimilate" you with their products?

Last edited by tk102; 05-25-2007 at 07:06 PM. Reason: fixed spacing
StormTrooper789 is offline   you may: quote & reply,
Old 09-12-2004, 06:03 PM   #2
Mono_Giganto
Giant Monkey of Doom™
 
Mono_Giganto's Avatar
 
Join Date: Dec 2003
Location: Florida
Posts: 2,478
Current Game: Baldur's Gate EE
Veteran Modder Helpful! 
I like random explosions.....



Nice job.

And thanks for explaining it.




Mono_Giganto is offline   you may: quote & reply,
Old 09-12-2004, 06:36 PM   #3
Darth333
Administraterror
 
Darth333's Avatar
 
Status: Administrator
Join Date: Feb 2004
Location: In my secret dungeon...
Posts: 8,292
This is always fun to play with
Darth333 is offline   you may: quote & reply,
Old 09-12-2004, 06:42 PM   #4
Darth Dex
Forumite
 
Darth Dex's Avatar
 
Join Date: Jun 2004
Location: Look at a Map
Posts: 516
This is going to be fun!


When you start thinking you should just quit right there!

Ben says, "stop ruining my storys! You always ruin my storys."
Darth Dex is offline   you may: quote & reply,
Old 09-12-2004, 06:54 PM   #5
Achilles
Dapper Chimp
 
Achilles's Avatar
 
Join Date: May 2004
Posts: 8,204
Helpful! Veteran Modder Forum Veteran 
Definitely need more scripting tutorials. Nice work!
Achilles is offline   you may: quote & reply,
Old 09-12-2004, 07:24 PM   #6
RedHawke
Shadow Lord Of The Sith™
 
RedHawke's Avatar
 
Status: Moderator
Join Date: Mar 2004
Location: Stormreach CA.
Posts: 9,184
Current Game: DDO, Stormreach
[Insert Evil Gary Oldman as Dracula Laugh here]

Very nice StormTrooper789!


"Beware the form-fitting black armor-clad Drow hottie with twin Mineral II Greensteel Khopeshes!"
"Liella d'Orien says, '"You're the fool, Devil. -- Witness the power of this fully ARMED and OPERATIONAL Titan!"'"
----------------------------------------------------------------------
RedHawke is offline   you may: quote & reply,
Old 09-13-2004, 06:01 AM   #7
stingerhs
Follow the Wolves
 
stingerhs's Avatar
 
Status: Moderator
Join Date: May 2004
Location: between my ears
Posts: 4,641
Current Game: Dead Space
Forum Veteran Roleplayer LFN Staff Member Helpful! 
Quote:
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.


See the struggle of the faithless lot as they negate their time
How low to sink to the depths of their frame of mind

stingerhs is offline   you may: quote & reply,
Old 09-13-2004, 03:15 PM   #8
StormTrooper789
Junior Member
 
StormTrooper789's Avatar
 
Join Date: Jun 2004
Location: Millington,TN
Posts: 258
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.


I scored 12.03156% on the Geek Test.
What about you?

Official Internet Exploiter hater!

Did you know Microsoft wants to "Assimilate" you with their products?
StormTrooper789 is offline   you may: quote & reply,
Old 09-21-2004, 07:49 AM   #9
*Yoinked*
Junior Member
 
*Yoinked*'s Avatar
 
Join Date: Aug 2004
Location: foster kid in Alabama
Posts: 380
BOOOOOOOOOOOOOOOOOOOOOOM!!!!!!
I like it!Keep it up O Great Scriptmaster ,
You always think of more and more ways to benifit this awsome modding community, and have been somewhat of an inspiration for me, THANKS!!


"Live is about taking risks: place your bet!"

350+ posts yay!!
*Yoinked* is offline   you may: quote & reply,
Old 10-16-2006, 01:34 PM   #10
Darth-Meatbag
Rookie
 
Join Date: Sep 2006
Posts: 69
I tip my lightsaber off to you. Thanks for a great script! ^^

~Darth Meatbag


Log in? No. Never again.
Darth-Meatbag is offline   you may: quote & reply,
Old 10-16-2006, 02:26 PM   #11
Ali Gelmar
Rookie
 
Ali Gelmar's Avatar
 
Join Date: Sep 2006
Posts: 88
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.
Ali Gelmar is offline   you may: quote & reply,
Old 10-16-2006, 02:41 PM   #12
stoffe
Network Caretaker
 
stoffe's Avatar
 
Status: Administrator
Join Date: Apr 2002
Posts: 5,833
Helpful! 10 year veteran! Notable contributor 
Quote:
Originally Posted by Darth-Meatbag
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.

Quote:
Originally Posted by Ali Gelmar
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.
stoffe is offline   you may: quote & reply,
Old 10-16-2006, 03:49 PM   #13
goldberry
Forumite
 
goldberry's Avatar
 
Join Date: Dec 2005
Location: London, Enfield
Posts: 610
Well, since the necromancy has started, I'd just like to mention that this script is one that I still use today :P

goldberry is offline   you may: quote & reply,
Old 05-25-2007, 05:53 PM   #14
Mindtwistah
Junior Member
 
Mindtwistah's Avatar
 
Join Date: Apr 2007
Location: Derka Derka
Posts: 470
Sorry for bringing this old thread up, but is the script for K1?
Mindtwistah is offline   you may: quote & reply,
Old 05-25-2007, 06:31 PM   #15
Master Zionosis
Relax On Air
 
Master Zionosis's Avatar
 
Join Date: Sep 2006
Location: High In The Sky
Posts: 1,280
Current Game: TR 8: Underworld
Contest winner - Modding 
Quote:
Originally Posted by Mindtwistah
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.

Quote:
Originally Posted by StormTrooper789
Have you ever wanted to make a module look like it's under attack like the Endar Spire?

Master Zionosis is offline   you may: quote & reply,
Old 05-25-2007, 06:55 PM   #16
Mindtwistah
Junior Member
 
Mindtwistah's Avatar
 
Join Date: Apr 2007
Location: Derka Derka
Posts: 470
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)
Mindtwistah is offline   you may: quote & reply,
Old 05-25-2007, 07:08 PM   #17
tk102
Well past expiration date
 
tk102's Avatar
 
Join Date: Jan 2004
Posts: 5,766
Current Game: Dragon Age: Origins
Forum Veteran Helpful! Notable contributor 
Stormtrooper789's code had a rogue space in it.
Try copy/pasting it again now and see if it compiles for you.
tk102 is offline   you may: quote & reply,
Old 05-26-2007, 03:00 AM   #18
Mindtwistah
Junior Member
 
Mindtwistah's Avatar
 
Join Date: Apr 2007
Location: Derka Derka
Posts: 470
Thanks for fixing it tk.
Mindtwistah 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 > Random Explosions Tutorial

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 03:08 AM.

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