Spawn with weapons/body

If you're looking for mapping help or you reckon you're a mapping guru, post your questions / solutions here

Moderator: Moderators

Post Reply
User avatar
chris_in_cali
Sergeant
Posts: 65
Joined: Thu Jun 26, 2003 9:46 am

Spawn with weapons/body

Post by chris_in_cali »

I can't find a tutorial that mentions this, and I'm not sure where to look (entity list?). I've been playing with maps, but they're all oh-so quite. That's fine, for now, but I'd like to spawn with a body and some weaponry. How do I do this?
Yarik
General
Posts: 1031
Joined: Thu Jan 09, 2003 7:12 pm
Contact:

Post by Yarik »

What do you mean spawn with a body?
But you can spawn with a weapon. You just need to add a line to your map source.
Skype: Yarik_usa
www.skype.com <---free pc2pc phone
Image
User avatar
chris_in_cali
Sergeant
Posts: 65
Joined: Thu Jun 26, 2003 9:46 am

Post by chris_in_cali »

Yeah... weapons, hands, and stuff. What do I need to add?
Krane
Lieutenant General
Posts: 782
Joined: Sat May 31, 2003 4:18 pm
Location: California, USA
Contact:

Post by Krane »

When you start a SP game (your map is SP, right?) , you start with a body but you can't see it. You don't see your hands cause there's no weapon with you. Try to add this lines to your script after level waittil spawn:

thread give_weapons

give_weapons:
$player item weapons/thompsonsmg.tik
$player ammo smg 200
end


I'm not good w/ scripts and I'm worst w/ SP maps but..just trying to help. :lol:
crunch
Major
Posts: 348
Joined: Sat Jun 14, 2003 2:34 pm
Location: USA
Contact:

Post by crunch »

For testing, you could also just put a weapon in your map right by the spawn point. You can then pick it up and use it.

Kill Ya Later!
User avatar
chris_in_cali
Sergeant
Posts: 65
Joined: Thu Jun 26, 2003 9:46 am

Post by chris_in_cali »

It's an AA map, and thanks for the second tip on just laying a weapon... figured I could do that myself. As for the scripting, it sounded like you were telling me to do that in-game to give myself a weapon; can't I just do something to have me spawn with specific weapons?
User avatar
chris_in_cali
Sergeant
Posts: 65
Joined: Thu Jun 26, 2003 9:46 am

Post by chris_in_cali »

Ok... I know there must be a way to have folks start with weapons in single player games. How is this done? (not the throwing weapons at peoples feet "trick")
Ramah Palmer
Warrant Officer
Posts: 131
Joined: Sun May 25, 2003 10:13 am
Location: Nottinghamshire: UK

Post by Ramah Palmer »

Surely Krane answered your question a couple of posts up. You have to create a .scr file in the same directory as your map and add those lines that he gave you to it. It is only a text file with the extension changed to .scr
nuggets
General
Posts: 1006
Joined: Fri Feb 28, 2003 2:57 am
Location: U-england-K (england in the UK) :P
Contact:

Post by nuggets »

where did simplicity go???

if you mean in your own map as i'm presuming you do if you see people with just legs and a torso, just select the enemy and press "I", from there you can select the weapon choice
hope this helps, prob not cos it's all foreign 2 me :-/
User avatar
chris_in_cali
Sergeant
Posts: 65
Joined: Thu Jun 26, 2003 9:46 am

Post by chris_in_cali »

I guess I'm just still mostly clueless about scripting. Do I have to attach the script to each character? Are these script lines to be included as part of a larger script? Sorry for beating this horse, I just want to understand things well.
crunch
Major
Posts: 348
Joined: Sat Jun 14, 2003 2:34 pm
Location: USA
Contact:

Post by crunch »

Ramah Palmer is correct. Krane has already answered you question.

If you are making a single player map, then you must "give" the player items.
This is done through scripting.
Every level needs a script. In your case, it would include what Krane said about weapons. You decide the weapon that you want the player to start with in the level, and use Krane's script to "give" it to him at the start of the level.

If you are making a Multiplayer map, then the player will choose his weapon once he is in the game.

Often, once MBuilder has completed the compile, and you test your map by "pressing any key to continue" you will not have a weapon, nor will you hear sounds.

If you are making a Multiplayer map and want to hear sounds, and choose a weapon, simply copy your .bsp file into the dm folder, and then start the game normally.

If you have not packed your map into a .pk3 file, then the script that you write using notepad will need to be in the same game folder as your .bsp file.

Kill Ya Later!
User avatar
wacko
Field Marshal
Posts: 2085
Joined: Fri Jul 05, 2002 8:42 pm
Location: Germany

Post by wacko »

Probably not possible:
In a DM game, let the player jump over the team/weapon select menus and start as lets say allied with a pumpgun and not let him choose! Or give him NO weapon at all so he'd first had to find 1 in the game...
Or could I do so?
Krane
Lieutenant General
Posts: 782
Joined: Sat May 31, 2003 4:18 pm
Location: California, USA
Contact:

Post by Krane »

You only need 1 script file for each map. It's a normal txt file, you make it in Notepad and just change the extension from .txt to .scr got it? This file must have the same name of your map. Ex: mymap.bsp is your map file amd mymap.scr goes in the same directory (folder) of your bsp file.

If your map is a MP here's a good script example, containing all the "parts" that makes a script. Is not that hard.

http://map.moh-central.net/tutorials/dm_scripting.php

The SP script is not that different. If you want to start try copy and paste this to a Notepad and save as yourmapname.scr and put in the same folder with the BSP file. Don't need to compile, just run MOHAA.

main:

level waittil spawn

thread give_weapons

give_weapons:
$player item weapons/thompsonsmg.tik
$player ammo smg 200
end


btw Wacko, I think I saw something related to this...I'll try to find.
User avatar
chris_in_cali
Sergeant
Posts: 65
Joined: Thu Jun 26, 2003 9:46 am

Post by chris_in_cali »

Thanks Krane. I just needed clarity on the whole script issue. I wanted to start learning, but I wasn't sure of this basic thing. Can scripts also be written in parts and pulled up in the mohradiant menus?
Krane
Lieutenant General
Posts: 782
Joined: Sat May 31, 2003 4:18 pm
Location: California, USA
Contact:

Post by Krane »

Yeah, you can. In the Radiant, select the entity, press "N" and you'll notice some buttons in the lower right corner like "Del, Sound, Script"...Click on "Script and will bring to you a window where you can put the script.

But I've found this method quite frustrating for a reason: to change things you'll have to open Radiant, etc... Using a text file makes your life easier. You just open the script, change what you want, add things, etc. Save it and run MOHAA to test. Much easier, also, to have all "threads" in a single text file so you can clarify problems.
Post Reply