Page 1 of 1

Q about Adding items to MP Stock Maps

Posted: Tue Apr 27, 2004 11:54 pm
by Sir_Ryan
I recently read the great (and long sought after by moi) map scripting tutorial written by Blazin' MOHAA, available here.

I've had no problems with this tutorial, but I do have a question. Through changing the below code:

Code: Select all

//========================

local.fix1 = spawn script_model

local.fix1 model "weapons/thompsonsmg.tik"

local.fix1.origin = ( 886.83 295.72 163.13 ) 

local.fix1.angles = ( 0 0 0 )

local.fix1.scale = 1.0
which, of course, spawns a model of a Thompson in the set coords,
to this:

Code: Select all

//========================

local.fix1 = spawn item //Replaced "script_model" with "item"

local.fix1 model "weapons/thompsonsmg.tik"

local.fix1.origin = ( 886.83 295.72 163.13 ) 

local.fix1.angles = ( 0 0 0 )

local.fix1.scale = 1.0
I've found that I can actually add a weapon to these coords, and be able to pick it up once in-game. The problem is that I can't see the model! If I run over where it's supposed to be, I pick it up, but I'd like for everyone who plays (and myself included) to be able to actually see the model.


Any clues on how to get the model to appear before the weapon's picked up, and dissappear once it's been picked up?

:?

playerweapon_allied_thompson

Posted: Wed Apr 28, 2004 12:27 am
by tltrude
Replace "item" with "playerweapon_allied_thompson" and see if that works. Everything else would stay the same, although you don't really need the scale line (scale 1 is default).

something's not working right

Posted: Thu Apr 29, 2004 12:23 am
by Sir_Ryan
Tom,

I tried replacing "item" with "playerweapon_allied_thompson", and left everything the same, but now I can't even pick the weapon up, nor see the model. Should I take the

Code: Select all

local.fix1 model "weapons/thompsonsmg.tik"
line out, or what?

Still confused...

Posted: Thu Apr 29, 2004 2:28 am
by kai0ty
why not put both scripts in there so u have a fake tommy on the ground, and when u go to taht area u get the gun?

Posted: Thu Apr 29, 2004 3:31 am
by lizardkid
you're confusing him kai......
yes, the correct format for spawning that would be

spawn models/playerweapon/thompsonsmg.tik

make it a loop if yu want. add "origin" etc later

spawn models/playerweapon/thompsonsmg.tik "origin" "x y z"

angles and scale are unneeeded.

how do you make a loop?

Posted: Thu Apr 29, 2004 3:31 pm
by Sir_Ryan
Ok, after fiddling around with the script, I finally arrived at this:

Code: Select all

//==================

local.fix1 = spawn script_model

local.fix1 model "weapons/thompsonsmg.tik"

local.fix1.origin = ( 2213.26 -1583.33 -6.87 ) 

local.fix1.angles = ( 0 0 0 )

local.fix1.scale = 1.0 

//local.fix1 ghost //Remove this line to make solid

//=================

local.fix1 = spawn item

local.fix1 model "weapons/thompsonsmg.tik"

local.fix1.origin = ( 2213.26 -1583.33 -6.87 ) 

local.fix1.angles = ( 0 0 0 )

local.fix1.scale = 1.0 

//local.fix1 ghost //Remove this line to make solid
Which of course makes a model of a Thompson and an item at the same coords.

What I want to know is, how do you add a loop in the script like you mentioned, lizard?

:?:

Posted: Thu Apr 29, 2004 3:44 pm
by lizardkid
easily done m8 :wink:

Code: Select all

level.zero = 0
while(level.zero = 0)
{
//your thompson code
wait 10
}
that refreshes the thompson so more than one player can pick it up.

This works

Posted: Thu Apr 29, 2004 6:19 pm
by tltrude
Ok, I got a simpler form of it working. It will vanish and respawns in about 12 seconds, on its own.

Code: Select all

local.fix1 = spawn weapons/thompsonsmg.tik
local.fix1.alwaysdraw = 1
local.fix1.origin = ( 2213.26 -1583.33 -6.87 ) 
local.fix1.angles = ( 0 0 90 )
 
Notice the roll angle which makes it lay flat. Players can pick it up by touching it, or with thier use key. Of course, they must drop thier main weapon first, if it is not a Thompson.

Thanks, thanks a lot

Posted: Fri Apr 30, 2004 12:41 am
by Sir_Ryan
Danke, danke sch?n! The scripting works great! I appreciate your help guys! Now it's time for some map fixin' madness, baby!

:D