Q about Adding items to MP Stock Maps

Post your scripting questions / solutions here

Moderator: Moderators

Post Reply
User avatar
Sir_Ryan
Corporal
Posts: 28
Joined: Sat Jul 05, 2003 11:28 pm
Location: United States
Contact:

Q about Adding items to MP Stock Maps

Post 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?

:?
<><
Sir_Ryan
SirRyan.Pure-Fun.Com
[It's the Cheesiest]
User avatar
tltrude
Chuck Norris
Posts: 4774
Joined: Sun Jul 07, 2002 4:03 am
Location: Oklahoma, USA
Contact:

playerweapon_allied_thompson

Post 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).
Tom Trude,

Image
User avatar
Sir_Ryan
Corporal
Posts: 28
Joined: Sat Jul 05, 2003 11:28 pm
Location: United States
Contact:

something's not working right

Post 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...
<><
Sir_Ryan
SirRyan.Pure-Fun.Com
[It's the Cheesiest]
kai0ty
Brigadier General
Posts: 507
Joined: Fri Mar 19, 2004 1:45 am

Post 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?
There are only 10 kinds of people in this world; those who know what binary is, and those who don't.
lizardkid
Windows Zealot
Posts: 3672
Joined: Fri Mar 19, 2004 7:16 pm
Location: Helena MT

Post 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.
Moderator

۞
Abyssus pro sapientia
Olympus pro Ignarus
۞

AND STUFF™ © 2006
User avatar
Sir_Ryan
Corporal
Posts: 28
Joined: Sat Jul 05, 2003 11:28 pm
Location: United States
Contact:

how do you make a loop?

Post 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?

:?:
<><
Sir_Ryan
SirRyan.Pure-Fun.Com
[It's the Cheesiest]
lizardkid
Windows Zealot
Posts: 3672
Joined: Fri Mar 19, 2004 7:16 pm
Location: Helena MT

Post 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.
Moderator

۞
Abyssus pro sapientia
Olympus pro Ignarus
۞

AND STUFF™ © 2006
User avatar
tltrude
Chuck Norris
Posts: 4774
Joined: Sun Jul 07, 2002 4:03 am
Location: Oklahoma, USA
Contact:

This works

Post 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.
Tom Trude,

Image
User avatar
Sir_Ryan
Corporal
Posts: 28
Joined: Sat Jul 05, 2003 11:28 pm
Location: United States
Contact:

Thanks, thanks a lot

Post 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
<><
Sir_Ryan
SirRyan.Pure-Fun.Com
[It's the Cheesiest]
Post Reply