Spawn with weapons/body
Moderator: Moderators
- chris_in_cali
- Sergeant
- Posts: 65
- Joined: Thu Jun 26, 2003 9:46 am
Spawn with weapons/body
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?
- chris_in_cali
- Sergeant
- Posts: 65
- Joined: Thu Jun 26, 2003 9:46 am
-
Krane
- Lieutenant General
- Posts: 782
- Joined: Sat May 31, 2003 4:18 pm
- Location: California, USA
- Contact:
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.
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.
- chris_in_cali
- Sergeant
- Posts: 65
- Joined: Thu Jun 26, 2003 9:46 am
- chris_in_cali
- Sergeant
- Posts: 65
- Joined: Thu Jun 26, 2003 9:46 am
-
Ramah Palmer
- Warrant Officer
- Posts: 131
- Joined: Sun May 25, 2003 10:13 am
- Location: Nottinghamshire: UK
- chris_in_cali
- Sergeant
- Posts: 65
- Joined: Thu Jun 26, 2003 9:46 am
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!
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!
-
Krane
- Lieutenant General
- Posts: 782
- Joined: Sat May 31, 2003 4:18 pm
- Location: California, USA
- Contact:
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.
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.
- chris_in_cali
- Sergeant
- Posts: 65
- Joined: Thu Jun 26, 2003 9:46 am
-
Krane
- Lieutenant General
- Posts: 782
- Joined: Sat May 31, 2003 4:18 pm
- Location: California, USA
- Contact:
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.
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.
