![]() |
scripting help?
I can spawn weapons into stock and custom maps BUT i wanna make the respawn time longer but can't find out how. Also i wanna know if you can script in explosions into dest. vill like the ones in omaha?
|
i never figured out how to change the respawn time, but i would think that there has to be a setting somewhere.
as for the explosions, yes you do this fairly easily with a little scripting. a) get the coordinates of where you want the explosions to be. b) write a little thread into destroyed village that spawns them every random amount of seconds. it would something like... //(put this part at the main script section thread crazy_explosions //(put this part after the main section and before the very bottom crazy_explosions: local.waittime = randomint(45) + 15 // gets random # between 15 & 60 wait local.waittime spawn fx/explosion/mine.tik "origin" "x y z" //where x,y,&z are the coords // (i just guessed on the tiki file name above) goto crazy_exlosions |
of, don't forget an "end" line after the goto to end the thread
|
thanx,
I'll give it a run and tell ya how it came out |
here's the tik you guessed on "emmiters/fx_explosion_mine.tik" but i'v enever been able to get ANY of the emmiter tiks to work. Some one said it was a typo and use "emiters/fx_explosion_mine.tik" (one M) and that still didn't work. Any other ideas?
|
i tried to get emmiters to work and couldn't either.
but that's not how i got my mines to work. i am at work and don't have the game or pak files in front of me. (not sure if they are still at home either) but i am almost positive that i didn't use emmitters. There is an explosion model for mines, and i think that's what i used. try looking in models/fx/ or something like that. (if have all the game pak files unzipped, do a search through for any file that has mine in it) what i was doing was creating a minefield. i spawned triggers at certain locations. when the triggers were tripped, the result was a spawn of a mine explosion. you are basically trying to do the same thing, but spawning the mine explosions on a schedule instead of through a trigger. |
Quote:
|
where the x, y, and z are.
and like this... spawn blah/blah.tik "origin" "1000 -1000 1000" |
thanx... I'll give it a shot
|
coord in console.
|
[quote="Lt. SnowBall [70th ID]A2":43ca0]coord in console.[/quote:43ca0]
LOL i know that but the script didn't work :-( |
|
so
|
what was the problem with the script?
|
i did what you sent, put in the coords and it never worked
|
okay, but what was the problem?
did the whole script bomb out? (you would know if this happend because the sound wouldn't work) did you look in the console to see what it said the problem was? |
nothing happened
|
something had to happen. it may not have worked, but then at least the console would have reported errors.
if you want, email me your script if you can't get it working. i could take a look at it |
before we get into this anymore will the exposions kill players?? that's what i really want them to do
|
it will the same as a mine exploding, so yes it will.
|
sent you the .scr
|
i just emailed back the script. let me know how you make out
|
this script will work. i tested it. it may be too complicated, and i think emitters work much easier, but anyway here it is.
(you just put this thread in your map script. then add a line "thread randommine1" to the main section of the script. you can add as many of these as you like by incrementing the variable numbers and changing the coordinates. i.e. randommine# and $mine#) randommine1: local.waitformine = (randomint(45) + 10) wait local.waitformine spawn animate/fx_explosion_mine "targetname" "mine1" $mine1.origin = ( -981 -2998 -63) $mine1 anim start if ($player == NULL) local.dudes=0 else local.dudes = $player.size if (local.dudes > 0) local.dude = exec global/makearray.scr $player for (local.i=1;local.i<local.dudes+1;local.i++) { if (vector_length ($mine1.origin - local.dude[local.i].origin) < 300) local.dude[local.i] exec global/bullethit.scr (0 -1 0) 800 50 1 } wait 4 $mine1 remove goto randommine1 end |
thanx... again i'll give it a run and let you know how it turns out
|
if you didn't get my email yet, i sent you your script back updated with all 4 mines and this scripting code
|
they work!! woo hoo. I only see 3 of the 4 going off though, i'll check to see whick set of coords it is and see if i can spot the prob. I'll let ya know. Thanx again for the hlep bro
|
tip about coordinates:
if you are pretty sure your coordinates are correct but the spawns aren't working, try adding about 20 to the Z value. usually when you get coordinates, you get them through the console from your own position. but the system takes them from your feet. so the system may be spawning your stuff right at ground level or a little below (especially if you were standing on unlevel ground when you got your coordinates). so, how do the mines look? oh note....you can change the radius of the mine. in the script, the value of 300 is used now (the one which measures vector length). you can change that. |
they look great, i knew the coord were foot level. I'll poke around a bit. so if i made the 300 higher it's a bigger blast right?
|
yup
|
could u post the script bluebrooks? it would be much appreciated.
|
it's in this thread in red above...^^^^^
|
i see... well i have a more daunting task... can u explain all the code with comments... like repost the script with comments explaining what stuff does.... see im a n00b scripter trying to learn how to do this, so it would be a tremendous help to me. thank you!
|
randommine1:
(this line names the thread local.waitformine = (randomint(45) + 10) (generates a random number between 10 and 55 wait local.waitformine (delays the thread for x amount of seconds spawn animate/fx_explosion_mine "targetname" "mine1" (generates a mine explosion that hasn't yet blown up $mine1.origin = ( -981 -2998 -63) (puts the mine in a specific place on the map $mine1 anim start (blows up the mine if ($player == NULL) local.dudes=0 else local.dudes = $player.size (last 4 lines determine how many people are playing on the board if (local.dudes > 0) local.dude = exec global/makearray.scr $player (last 2 lines create a listing of the people playing for (local.i=1;local.i<local.dudes+1;local.i++) { if (vector_length ($mine1.origin - local.dude[local.i].origin) < 300) local.dude[local.i] exec global/bullethit.scr (0 -1 0) 800 50 1 } (last 5 lines spin through all the people. if they close to the mine, it kills (them wait 4 (waits 4 seconds $mine1 remove (takes the old mine off the map goto randommine1 (starts the thread all over again end (marks the end of the thread |
thanks man! very useful.
|
ok heres what i would like to do... how would i make a varible that makes a random number between 1-1000, and then how do i call up that varible later on.
|
add a line...
local.yourcrazyassvariable = randomint(1000) then whenever you need that number later, use the name. as in (like above) wait local.yourcrazyassvariable |
y got the 4th mine to work, just had to change the coords. changing the 300 higher increases the "kill area" but is there a way to make the effects bigger? like scale 1.0 is normal, scale 2.0 is 2x bigger and so on? Thanx again for the help and I'm glad the thread ended up helpin another guy!!
|
don't know about th effects size.
you can go into the animate/fx_explosion_mine.tik file and play with the scale to see what happens. you might end up having to change other tik files too. like in the mine tiki and see if it references other tiki files when it animates. I think scale works backwords. As in scale 1.0 is smaller than 0.5. I forget though |
I'll just leave them the stock size. But the scale does go up to male the models larger.
|
where in an OBJ .scr would i put this script to add the mines??
|
All times are GMT -6. The time now is 02:36 PM. |
Powered by vBulletin® Version 3.8.12 by ScriptzBin
Copyright ©2000 - 2025, vBulletin Solutions Inc.
© 1998 - 2007 by Rudedog Productions | All trademarks used are properties of their respective owners. All rights reserved.