Alliedassault           
FAQ Calendar
Go Back   Alliedassault > FPS Gaming General Discussion > MoH Maps, Mods & Skins
Reload this Page scripting help?
MoH Maps, Mods & Skins Discuss custom maps, skins and mods here.

Reply
 
Thread Tools Display Modes
Old
  (#31)
bluebrooks is Offline
Senior Member
 
Posts: 156
Join Date: Jun 2002
   
Default 08-28-2003, 03:37 PM

it's in this thread in red above...^^^^^
  
Reply With Quote
Old
  (#32)
chipsdw is Offline
Senior Member
 
Posts: 103
Join Date: Dec 2002
  Send a message via AIM to chipsdw  
Default 08-28-2003, 04: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!
  
Reply With Quote
Old
  (#33)
bluebrooks is Offline
Senior Member
 
Posts: 156
Join Date: Jun 2002
   
Default 08-28-2003, 04: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
  
Reply With Quote
Old
  (#34)
chipsdw is Offline
Senior Member
 
Posts: 103
Join Date: Dec 2002
  Send a message via AIM to chipsdw  
Default 08-28-2003, 04:21 PM

thanks man! very useful.
  
Reply With Quote
Old
  (#35)
chipsdw is Offline
Senior Member
 
Posts: 103
Join Date: Dec 2002
  Send a message via AIM to chipsdw  
Default 08-28-2003, 04: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.
  
Reply With Quote
Old
  (#36)
bluebrooks is Offline
Senior Member
 
Posts: 156
Join Date: Jun 2002
   
Default 08-28-2003, 04: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
  
Reply With Quote
Old
  (#37)
Dragonwraith is Offline
Senior Member
 
Posts: 1,609
Join Date: Mar 2003
Location: I'm a MASShole
   
Default 08-28-2003, 04: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!!
  
Reply With Quote
Old
  (#38)
bluebrooks is Offline
Senior Member
 
Posts: 156
Join Date: Jun 2002
   
Default 08-28-2003, 05: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
  
Reply With Quote
Old
  (#39)
Dragonwraith is Offline
Senior Member
 
Posts: 1,609
Join Date: Mar 2003
Location: I'm a MASShole
   
Default 08-28-2003, 05:15 PM

I'll just leave them the stock size. But the scale does go up to male the models larger.
  
Reply With Quote
Old
  (#40)
Dragonwraith is Offline
Senior Member
 
Posts: 1,609
Join Date: Mar 2003
Location: I'm a MASShole
   
Default 08-28-2003, 05:47 PM

where in an OBJ .scr would i put this script to add the mines??
  
Reply With Quote
Old
  (#41)
newt. is Offline
2nd Lieutenant
 
newt.'s Avatar
 
Posts: 3,025
Join Date: Mar 2002
   
Default 08-28-2003, 06:08 PM

waittillspawn

and end has to be after script
  
Reply With Quote
Old
  (#42)
chipsdw is Offline
Senior Member
 
Posts: 103
Join Date: Dec 2002
  Send a message via AIM to chipsdw  
Default 08-28-2003, 06:39 PM

so... if i wanted to randomize the placement of a mine could i do this?

randommine1:
(this line names the thread
local.waitformine = (randomint(45) + 10)

local.rndnum = randomint(1000)
local.rndnum2 = randomint(1000)
local.rndnum3 = randomint(1000)

wait local.waitformine
spawn animate/fx_explosion_mine "targetname" "mine1"

$mine1.origin = ( -wait local.rndnum -wait local.rndnum2 -wait local.rndnum3)
(puts the mine in a specific place on the map
$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
  
Reply With Quote
Old
  (#43)
chipsdw is Offline
Senior Member
 
Posts: 103
Join Date: Dec 2002
  Send a message via AIM to chipsdw  
Default 08-28-2003, 07:21 PM

and while were on the subject of scripting... would this work?

if ($player say fuck)
$player takeall
  
Reply With Quote
Old
  (#44)
bluebrooks is Offline
Senior Member
 
Posts: 156
Join Date: Jun 2002
   
Default 08-29-2003, 08:38 AM

the coordinate thing won't work.
it would be....
$mine1.origin = ( local.num1 local.num2 local.num3)
so leave out the "wait"s

also, although this will work, your mines will be all over the place. as in, under the board, up in the air, off the board completely, etc.
it would work better on a flat board, like snowy park. so you could make the x and y coords random, and keep the z coord constant, so they all blow up around foot level.
but even that, you'd need to find the center of the board and set the x and y's based off that.

for instance, say the center of the board is ( 5000, -4000, 500)
and the board stretches out for 3000 units to hit each side from the center,
then make
local.x = (randomint(6000) + 2000))
local.y = (randomint(6000) - 7000))
that would make x a number from 2000 to 8000 (+ or - 3000 from center)
and y would be a number from -7000 to -1000 (again, + or - 3000 from center)
  
Reply With Quote
Old
  (#45)
chipsdw is Offline
Senior Member
 
Posts: 103
Join Date: Dec 2002
  Send a message via AIM to chipsdw  
Default 08-29-2003, 09:48 AM

blue brooks do u have AIM cus i have a lot of little questions like what exactly does $player mean and stuff.
  
Reply With Quote
Reply



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



Powered by vBulletin® Version 3.8.12 by ScriptzBin
Copyright ©2000 - 2025, vBulletin Solutions Inc.
vBulletin Skin developed by: vBStyles.com
© 1998 - 2007 by Rudedog Productions | All trademarks used are properties of their respective owners. All rights reserved.