need help with adding weapons with .scr Single Player

Post your scripting questions / solutions here

Moderator: Moderators

Post Reply
User avatar
erick
Major
Posts: 280
Joined: Wed May 30, 2007 1:14 am
Location: USA

need help with adding weapons with .scr Single Player

Post by erick »

I tried to make my player start on one of my SP levels with a gun but I dont know how to code this
could anyone tell me?

i am new to mapping so I dont know that much
any help would be appreciated
lizardkid
Windows Zealot
Posts: 3672
Joined: Fri Mar 19, 2004 7:16 pm
Location: Helena MT

Post by lizardkid »

You need a .scr file for your map. Make a .txt file and name it the exact same name as your map. Put it in the main>maps folder. Then put this code into the .txt file and save.

Code: Select all

main:

level waittill prespawn
level waittill spawn

thread giveGuns

end

giveGuns:

$player item weapons/colt45.tik
$player item weapons/thompsonsmg.tik

$player ammo pistol 1000
$player ammo smg 1000

end

valid weapons are...
  • colt45
    p38
    m1garand
    kar98
    thompsonsmg
    mp40
    bar
    mp44
    bazooka
    panzerschreck
    shotgun
and ammos
  • pistol
    rifle
    smg
    mg
    heavy
Last edited by lizardkid on Thu May 31, 2007 7:02 am, edited 1 time in total.
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:

loadout

Post by tltrude »

In pak0 look at global/loadout.scr .

$player useweaponclass smg

"Useweaponclass" is the weapon the player starts with.

In Lizardkid's example it would look like this, if you want the thompson.

Code: Select all

main: 

level waittill prespawn 
level waittill spawn 

thread giveGuns 

end 

giveGuns: 

$player item weapons/colt45.tik 
$player item weapons/thompsonsmg.tik 

$player ammo pistol 1000 
$player ammo smg 1000 

$player useweaponclass smg

end 
The use weapon class names are:

smg
rifle
pistol
mg

The player must have the item before it can be used.
Tom Trude,

Image
User avatar
erick
Major
Posts: 280
Joined: Wed May 30, 2007 1:14 am
Location: USA

Post by erick »

thanks for the help

it worked
Post Reply