Alliedassault

Alliedassault (alliedassault.us/index.php)
-   MoH Maps, Mods & Skins (alliedassault.us/forumdisplay.php?f=11)
-   -   scripting help? (alliedassault.us/showthread.php?t=29500)

Dragonwraith 08-24-2003 06:37 PM

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?

bluebrooks 08-25-2003 12:11 PM

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

bluebrooks 08-25-2003 12:12 PM

of, don't forget an "end" line after the goto to end the thread

Dragonwraith 08-25-2003 01:22 PM

thanx,
I'll give it a run and tell ya how it came out

Dragonwraith 08-25-2003 01:29 PM

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?

bluebrooks 08-26-2003 10:06 AM

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.

Dragonwraith 08-26-2003 02:51 PM

Quote:

Originally Posted by bluebrooks

//(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

to make them work you use "emitters" ONE M ans TWO T's... i got smoke sparks and all that stuff to work but i have a question about the script you sent. Do the coors go where "origin" or where "x y & z" go?

bluebrooks 08-26-2003 02:53 PM

where the x, y, and z are.

and like this...
spawn blah/blah.tik "origin" "1000 -1000 1000"

Dragonwraith 08-26-2003 02:53 PM

thanx... I'll give it a shot

newt. 08-26-2003 02:59 PM

coord in console.

Dragonwraith 08-26-2003 06:41 PM

[quote="Lt. SnowBall [70th ID]A2":43ca0]coord in console.[/quote:43ca0]

LOL i know that but the script didn't work :-(

newt. 08-26-2003 07:05 PM

and I wrote it.

http://www.n00b-allstars.com/mohoe/foru ... ic.php?t=9

Dragonwraith 08-27-2003 08:42 AM

so

bluebrooks 08-27-2003 08:54 AM

what was the problem with the script?

Dragonwraith 08-27-2003 09:03 AM

i did what you sent, put in the coords and it never worked

bluebrooks 08-27-2003 09:07 AM

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?

Dragonwraith 08-27-2003 09:13 AM

nothing happened

bluebrooks 08-27-2003 09:17 AM

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

Dragonwraith 08-27-2003 09:19 AM

before we get into this anymore will the exposions kill players?? that's what i really want them to do

bluebrooks 08-27-2003 09:24 AM

it will the same as a mine exploding, so yes it will.

Dragonwraith 08-27-2003 09:30 AM

sent you the .scr

bluebrooks 08-27-2003 10:28 AM

i just emailed back the script. let me know how you make out

bluebrooks 08-28-2003 07:06 AM

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

Dragonwraith 08-28-2003 11:48 AM

thanx... again i'll give it a run and let you know how it turns out

bluebrooks 08-28-2003 11:52 AM

if you didn't get my email yet, i sent you your script back updated with all 4 mines and this scripting code

Dragonwraith 08-28-2003 11:59 AM

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

bluebrooks 08-28-2003 12:08 PM

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.

Dragonwraith 08-28-2003 12:27 PM

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?

bluebrooks 08-28-2003 12:39 PM

yup

chipsdw 08-28-2003 02:22 PM

could u post the script bluebrooks? it would be much appreciated.

bluebrooks 08-28-2003 02:37 PM

it's in this thread in red above...^^^^^

chipsdw 08-28-2003 03:01 PM

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!

bluebrooks 08-28-2003 03:13 PM

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

chipsdw 08-28-2003 03:21 PM

thanks man! very useful.

chipsdw 08-28-2003 03:25 PM

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.

bluebrooks 08-28-2003 03:38 PM

add a line...
local.yourcrazyassvariable = randomint(1000)

then whenever you need that number later, use the name.
as in (like above)
wait local.yourcrazyassvariable

Dragonwraith 08-28-2003 03:54 PM

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!!

bluebrooks 08-28-2003 04:09 PM

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

Dragonwraith 08-28-2003 04:15 PM

I'll just leave them the stock size. But the scale does go up to male the models larger.

Dragonwraith 08-28-2003 04:47 PM

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.