Page 1 of 1
Spawn with weapons/body
Posted: Thu Jun 26, 2003 10:31 pm
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?
Posted: Thu Jun 26, 2003 10:58 pm
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.
Posted: Thu Jun 26, 2003 11:01 pm
by chris_in_cali
Yeah... weapons, hands, and stuff. What do I need to add?
Posted: Fri Jun 27, 2003 12:48 am
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.

Posted: Fri Jun 27, 2003 1:09 am
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!
Posted: Fri Jun 27, 2003 4:06 am
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?
Posted: Sat Jun 28, 2003 5:42 am
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")
Posted: Sat Jun 28, 2003 1:52 pm
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
Posted: Sat Jun 28, 2003 2:09 pm
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
Posted: Sun Jun 29, 2003 5:10 am
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.
Posted: Sun Jun 29, 2003 7:20 pm
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!
Posted: Sun Jun 29, 2003 9:18 pm
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?
Posted: Mon Jun 30, 2003 3:20 am
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.
Posted: Mon Jun 30, 2003 7:32 am
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?
Posted: Mon Jun 30, 2003 2:12 pm
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.