Random Lightning Bolts

Post your scripting questions / solutions here

Moderator: Moderators

wizard220
Private
Posts: 9
Joined: Tue Jul 15, 2003 11:54 am

Random Lightning Bolts

Post by wizard220 »

ok here is the code:

lightingbolts:

level.lightning[1] = ( -376 496 385 ) // Strike1
level.lightning[2] = ( 844 309 385 ) // Strike2
level.lightning[3] = ( 440 1559 385 ) // Strike3
level.lightning[4] = ( 1095 3102 561 ) // Strike4
level.lightning[5] = ( 210 269 49 ) // Strike5
level.lightning[6] = ( -291 2300 385 ) // Strike6
level.lightning[7] = ( -1184 1812 105 ) // Strike7
level.lightning[8] = ( 1474 1068 219 ) // Strike8
level.beam = spawn func_beam
local.beam.origin = level.lightning[(randomint(8)+1)]
level.beam.angles = ( -90 0 0 )
level.beam scale 3.0
level.beam minoffset 60
level.beam maxoffset 60
level.beam color ( 1 1 1)
level.beam numsegments 3
while(1) {
wait 4
level.beam activate
wait .2
level.beam deactivate
wait .2
}

end

And here is the error in log that shows for 1 time. Still no lightning being generated from the above 8 coords.

local.beam.origin = level.lightning[(randomint(8)+1)] (global/dm1funstuff.scr, 324)
local.beam^

^~^~^ Script Error: Cannot cast 'NIL' to listener
Raiders Chief of Staff
FPSAdmin Administrator
Image

Clanwarz Employee and Administrator
Image
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post by jv_map »

local.beam shall be level.beam :roll:
Image
wizard220
Private
Posts: 9
Joined: Tue Jul 15, 2003 11:54 am

Post by wizard220 »

Doh and Doh......... man thanks and i do need some sleep........
Raiders Chief of Staff
FPSAdmin Administrator
Image

Clanwarz Employee and Administrator
Image
User avatar
bdbodger
Moderator
Posts: 2596
Joined: Tue Feb 25, 2003 7:34 am
Location: canada
Contact:

Post by bdbodger »

If you go to your post a TMT I wrote a script for you that may help .
Image
wizard220
Private
Posts: 9
Joined: Tue Jul 15, 2003 11:54 am

Post by wizard220 »

Yes and it works great. I have also added the thunder crack sound thunder1 to the code. It all works awsome and thanks everyone for the help. But really i must have been really bushed to miss that mislabled line ini the code. hehe..... Thank You Sirs .....
Raiders Chief of Staff
FPSAdmin Administrator
Image

Clanwarz Employee and Administrator
Image
User avatar
tltrude
Chuck Norris
Posts: 4774
Joined: Sun Jul 07, 2002 4:03 am
Location: Oklahoma, USA
Contact:

Nice

Post by tltrude »

Very nice, but now get it to cause flashes of light and small explosions on the ground that kill players, ha ha. If that is not enough, try making where they hit completly random (within the comfines of the map)!
Tom Trude,

Image
User avatar
bdbodger
Moderator
Posts: 2596
Joined: Tue Feb 25, 2003 7:34 am
Location: canada
Contact:

Post by bdbodger »

Well it has this in the SDK give it a try .

shoot

Make the beam cause damage to entities that get in the way

shootradius( Float radius )

Set the radius of the damage area between beam endpoints
Image
wizard220
Private
Posts: 9
Joined: Tue Jul 15, 2003 11:54 am

Post by wizard220 »

bdbodger wrote:Well it has this in the SDK give it a try .

shoot

Make the beam cause damage to entities that get in the way

shootradius( Float radius )

Set the radius of the damage area between beam endpoints
Huh ???? ok now that would be awsome as you know what. If you get hit or too close then you can DIE DIE DIE DIE DIE....LOL LOL ok here is the code for Southern France. As you can see I have 19 strikes placed thro out the map. What I have found is that if the line of sight from cloud to ground is NOT blocked by a building, bridge, over hang, roof etc.. then the bolt will do good. But if the coords fall within the building then the bolt is inside the building and you see nothing outside. Ok now someone mentioned random using the size fo the map. Can that be done?? I have no idea on what to do in that regard. Also What do I need to make the lightning bolt to hurt/kill you. I have no clue. But if you can do up the random strikes using map size then please do. I also have a greysky mod that darkens the sky up a bit. SF looks so different now......

lightningbolts:

level.lightning[0] = ( -95 -724 16 ) // Strike1
level.lightning[1] = ( 555 -541 16 ) // Strike2
level.lightning[2] = ( 556 -955 16 ) // Strike3
level.lightning[3] = ( 419 -13 64 ) // Strike4
level.lightning[4] = ( -43 -75 56 ) // Strike5
level.lightning[5] = ( -325 -52 64 ) // Strike6
level.lightning[6] = ( 240 675 100 ) // Strike7
level.lightning[7] = ( -221 767 104 ) // Strike8
level.lightning[8] = ( 660 761 104 ) // Strike9
level.lightning[9] = ( 1093 -595 352 ) // Strike10
level.lightning[10] = ( 205 479 384 ) // Strike11
level.lightning[11] = ( -1197 1567 62 ) // Strike12
level.lightning[12] = ( -790 1793 129 ) // Strike13
level.lightning[13] = ( 134 1923 129 ) // Strike14
level.lightning[14] = ( 189 2907 257 ) // Strike15
level.lightning[15] = ( 560 2532 421 ) // Strike16
level.lightning[16] = ( -154 2314 385 ) // Strike17
level.lightning[17] = ( -670 2256 385 ) // Strike18
level.lightning[18] = ( -448 1410 385 ) // Strike19

for(local.b = 0;local.b < level.lightning.size;local.b++)
{
level.beam[local.b] = spawn func_beam
level.beam[local.b].origin = level.lightning[local.b]
level.beam[local.b].angles = ( -90 0 0 )
level.beam[local.b] scale 5
level.beam[local.b] minoffset 10
level.beam[local.b] maxoffset 10
level.beam[local.b] color ( 1 1 1)
level.beam[local.b] numsegments 50
}
while(1) {
local.random = randomint(level.beam.size)
wait 6
level.beam[local.random] activate
level.beam playsound thunder1
wait .1
level.beam[local.random] deactivate
wait 15
}
end

Would it be this:

level.beam[local.random] activate
level.beam shootradius( 50 )
level.beam playsound thunder1
Raiders Chief of Staff
FPSAdmin Administrator
Image

Clanwarz Employee and Administrator
Image
User avatar
tltrude
Chuck Norris
Posts: 4774
Joined: Sun Jul 07, 2002 4:03 am
Location: Oklahoma, USA
Contact:

brackets

Post by tltrude »

No brackets! Not sure, but I think it would be this way.

level.beam.shootradius = 50
Tom Trude,

Image
User avatar
bdbodger
Moderator
Posts: 2596
Joined: Tue Feb 25, 2003 7:34 am
Location: canada
Contact:

Post by bdbodger »

Or maybe

while(1) {
local.random = randomint(level.beam.size)
wait 6
level.beam[local.random].shootradius = 50
level.beam[local.random] activate
level.beam playsound thunder1
wait .1
level.beam[local.random] deactivate
wait 15
}

or

for(local.b = 0;local.b < level.lightning.size;local.b++)
{
level.beam[local.b] = spawn func_beam
level.beam[local.b].origin = level.lightning[local.b]
level.beam[local.b].angles = ( -90 0 0 )
level.beam[local.b] scale 5
level.beam[local.b] minoffset 10
level.beam[local.b] maxoffset 10
level.beam[local.b] color ( 1 1 1)
level.beam[local.b] numsegments 50
level.beam[loca.b].shootradius = 50
}
Image
wizard220
Private
Posts: 9
Joined: Tue Jul 15, 2003 11:54 am

Post by wizard220 »

Ok those didnt work either. I will work on that when Im finished with the 2 obj maps im working on. Thank you sirs and it would be awsome to get it to work........
Raiders Chief of Staff
FPSAdmin Administrator
Image

Clanwarz Employee and Administrator
Image
User avatar
bdbodger
Moderator
Posts: 2596
Joined: Tue Feb 25, 2003 7:34 am
Location: canada
Contact:

Post by bdbodger »

Just because it is in the SDK does not mean it works or maybe only works in spearhead .
Image
unmonitrd
Lance Corporal
Posts: 14
Joined: Fri Dec 26, 2003 5:47 pm

Post by unmonitrd »

bdbodger wrote: while(1) {
local.random = randomint(level.beam.size)
wait 6
level.beam[local.random].shootradius = 50
level.beam[local.random] activate
level.beam playsound thunder1
wait .1
level.beam[local.random] deactivate
wait 15
}

or

for(local.b = 0;local.b < level.lightning.size;local.b++)
{
level.beam[local.b] = spawn func_beam
level.beam[local.b].origin = level.lightning[local.b]
level.beam[local.b].angles = ( -90 0 0 )
level.beam[local.b] scale 5
level.beam[local.b] minoffset 10
level.beam[local.b] maxoffset 10
level.beam[local.b] color ( 1 1 1)
level.beam[local.b] numsegments 50
level.beam[loca.b].shootradius = 50
}
I was playing around with this a bit, I think a white corona around the func_beam would make it look pretty wicked (esp. with fog) Is it possible to attach a corona somewhere inside these 2 nested loops?

Also...just out of curiosity, does the "shoot" thing actually work? Usually a thread with no further replies means the last post is a solution (either that or a total lack of continuing interest suddenly arose :wink: )

-Unm
User avatar
bdbodger
Moderator
Posts: 2596
Joined: Tue Feb 25, 2003 7:34 am
Location: canada
Contact:

Post by bdbodger »

No I don't think the shoot thing works . I did some tests with a friends map and could not get it to work .
Image
unmonitrd
Lance Corporal
Posts: 14
Joined: Fri Dec 26, 2003 5:47 pm

Post by unmonitrd »

I'm not very surprised by the shoot thing. I'd never seen it used before. Perhaps the coords could be fed to the ground location and an explosion triggered there with no visible effects but the damage params kept intact? (or better yet...maybe WITH the dirt & ground blast shaders - but no other explosion visuals or sound - that might look pretty cool)

But on a more pressing note:

I've never actually had a use for a corona before. Can it merely be attached to the func_beam in the for loop (I'm using the lower example) when it's entered & then just activated a moment later?? How would I go about attaching a corona to a beam (if it's even possible?) I tried searching for examples...to no avail though.

-Unm
Post Reply