how to play a map i created
Moderator: Moderators
-
BatteryAziz
- Moderator
- Posts: 82
- Joined: Tue Jun 15, 2010 4:44 pm
Re: how to play a map i created
sure! but please check the tutorials first
most (if not all) of the basic stuff you can find here. if you tried the tutorials but somethings are still not working, you can always ask!
Re: how to play a map i created
alright, i read the doors tutorial and i didn't find an answer for these 2 questions ..
* when i make a rotating door it opens only in one direction, how can i make it open in the direction that is opposite to the one i'm coming from ?
* sometimes when i make a targeted sliding door and then check the toggle box the door stops working .. any idea why ?
* when i make a rotating door it opens only in one direction, how can i make it open in the direction that is opposite to the one i'm coming from ?
* sometimes when i make a targeted sliding door and then check the toggle box the door stops working .. any idea why ?
-
BatteryAziz
- Moderator
- Posts: 82
- Joined: Tue Jun 15, 2010 4:44 pm
Re: how to play a map i created
1. doors need an angle too. 0 does the same as 180, 90 and 270 likewise.
2. you mean sometimes it does work? don't forget to use a trigger_multiple with key/value target/mytriggerdoor1 and set the door to have targetname/mytriggerdoor1. you can also simply click the trigger and then the door, and then hit CTRL+K (that way you get a connecting arrow too) but then it names the target+targetname automatically.
2. you mean sometimes it does work? don't forget to use a trigger_multiple with key/value target/mytriggerdoor1 and set the door to have targetname/mytriggerdoor1. you can also simply click the trigger and then the door, and then hit CTRL+K (that way you get a connecting arrow too) but then it names the target+targetname automatically.
Re: how to play a map i created
ok i think that would be it
thank u so much u helped me a lot
thank u so much u helped me a lot
-
BatteryAziz
- Moderator
- Posts: 82
- Joined: Tue Jun 15, 2010 4:44 pm
Re: how to play a map i created
no sweat! how's your map coming along?
Re: how to play a map i created
well the past few days i was learning the basics, so i have just started working on my real map and it's going well so far except for one thing ..
i want to make a rotating door that rotates about a horizontal axis like the one in the picture, but it just keeps rotating about a vertical axis, i tried to set the angle of the door to -1 but it didn't work, please help
i want to make a rotating door that rotates about a horizontal axis like the one in the picture, but it just keeps rotating about a vertical axis, i tried to set the angle of the door to -1 but it didn't work, please help
- Attachments
-
- Untitled.png (170.95 KiB) Viewed 469 times
-
BatteryAziz
- Moderator
- Posts: 82
- Joined: Tue Jun 15, 2010 4:44 pm
Re: how to play a map i created
the -1/-2 angles are meant only for a sliding func_door, unfortunately. if you want a rotating hatch door, you're gonna have to script it. if you've gone through the basics of scripting, it's easy to make it work. you're going to need a trigger_use and/or trigger_multiple to trigger the script and make use of $myhatch1 rotatexupto/rotateyupto 90 to make the hatch (which you make into a script_object with the origin brush at its pivot point and targetname myhatch1) go up 90 degrees, and $myhatch1 rotatexdownto/rotateydownto 0 to make it go down again.
anyway, let me know when you're ready to do some basic scripting, i'll help you get the hang of it.
anyway, let me know when you're ready to do some basic scripting, i'll help you get the hang of it.
Re: how to play a map i created
i'll really appreciate it if u helped me with the scripting, i tried to learn it from some tutorials but it wasn't really useful to me..
Re: how to play a map i created
i also have some questions ..
* how big can a map be ? i mean it surly can't be infinite ..
* how can i put an image in the map loading screen ?
* i downloaded Xfire but i don't know what it's good for
..
* how big can a map be ? i mean it surly can't be infinite ..
* how can i put an image in the map loading screen ?
* i downloaded Xfire but i don't know what it's good for
-
BatteryAziz
- Moderator
- Posts: 82
- Joined: Tue Jun 15, 2010 4:44 pm
Re: how to play a map i created
1. map size can be huge, but it's limited by a vis data size of 2 megabytes. vis stands for visibility. if you choose -fast during compile, it skips this process so in-game everything will be rendered all the time. you're still limited to vis size of 2 MB however.
(note: using -fast vis is OK for small maps. for big complex maps you need to do a full vis (leave VIS Options in mbuilder empty). it will then calculate the visibility tree of what you can/can't potentially see, so in-game you get better performance. to take advantage of this compile step you need to play around with structural and detail brushes in mohradiant, but if your map is small ignore it for now
)
2. to get a loading screen, you basically need to do the following steps once. for every new map you make you simply copy and edit the files so it works.
add the following folders in your pk3 file:
*\textures\mohmenu\dmloading
*\scripts
*\ui
what i do is this: I make a screenshot which is 1280x960 from the game, then I crop it so there's no healthbar and compass etc, then resize it to 1024x606, maybe add some color filter/effect and save as mydmloadingscreen.jpg and copy it into *\textures\mohmenu\dmloading\
now you need a .shader file (as you do with every custom texture).
open up notepad, paste the code below and edit
make sure the path+filename to your .jpg is correct
in notepad save as "all files" mydmloadingscreen.shader
put this .shader file in the *\scripts\ folder.
now you need a .urc file which belongs in the *\ui\ folder. this file will call the shader you just made when you load your map.
open up notepad again, paste the code below and edit
make sure everything is correct
in notepad save as "all files" mymapname.urc (how you call on your map in-game which is determined by your mymapname.bsp)
put this .urc file in the *\ui\ folder.
That should do it. if it doesn't work right away, take my map's pk3 as reference, check the .shader and .urc files with yours.
now, to get this loading screen also as your scoreboard pic, do the following:
open notepad again, paste the following code and edit
in notepad save as "all files" mymapname.scr (same as your .bsp name) and save it in *\maps\dm\ besides your mymapname.bsp
this .scr file is the file that you use for scripting, make stuff move around, create an objective, call other scripts etc.
3. xfire is just a game server browser, you can chat with other people and join their server etc
(note: using -fast vis is OK for small maps. for big complex maps you need to do a full vis (leave VIS Options in mbuilder empty). it will then calculate the visibility tree of what you can/can't potentially see, so in-game you get better performance. to take advantage of this compile step you need to play around with structural and detail brushes in mohradiant, but if your map is small ignore it for now
2. to get a loading screen, you basically need to do the following steps once. for every new map you make you simply copy and edit the files so it works.
add the following folders in your pk3 file:
*\textures\mohmenu\dmloading
*\scripts
*\ui
what i do is this: I make a screenshot which is 1280x960 from the game, then I crop it so there's no healthbar and compass etc, then resize it to 1024x606, maybe add some color filter/effect and save as mydmloadingscreen.jpg and copy it into *\textures\mohmenu\dmloading\
now you need a .shader file (as you do with every custom texture).
open up notepad, paste the code below and edit
Code: Select all
mydmloadingscreen
{
nomipmaps
nopicmip
cull none
force32bit
surfaceparm nolightmap
{
map $whiteimage
}
{
clampMap textures/mohmenu/dmloading/mydmloadingscreen.jpg
}
}
in notepad save as "all files" mydmloadingscreen.shader
put this .shader file in the *\scripts\ folder.
now you need a .urc file which belongs in the *\ui\ folder. this file will call the shader you just made when you load your map.
open up notepad again, paste the code below and edit
Code: Select all
menu "dm/mymapname" 640 481 NONE 0 // <--- how you call on your map in-game which is determined by your mymapname.bsp
bgcolor 0 0 0 1
borderstyle NONE
bgfill 0 0 0 1
fullscreen 1
//vidmode 3
//fadein 0.5
virtualres 1
postinclude ui/loadingbar.txt
resource
Label
{
name "Default"
rect 0 248 256 256
fgcolor 1.00 1.00 1.00 1.00
bgcolor 0.50 0.50 0.50 0.00
borderstyle "NONE"
shader "paper"
}
resource
Label
{
name "Default"
rect 248 248 256 256
fgcolor 1.00 1.00 1.00 1.00
bgcolor 0.50 0.50 0.50 0.00
borderstyle "NONE"
shader "paper"
}
resource
Label
{
name "Default"
rect 496 248 256 256
fgcolor 1.00 1.00 1.00 1.00
bgcolor 0.50 0.50 0.50 0.00
borderstyle "NONE"
shader "paper"
}
resource
Label
{
name "Default"
rect 496 0 256 256
fgcolor 1.00 1.00 1.00 1.00
bgcolor 0.50 0.50 0.50 0.00
borderstyle "NONE"
shader "paper"
}
resource
Label
{
name "Default"
rect 248 0 256 256
fgcolor 1.00 1.00 1.00 1.00
bgcolor 0.50 0.50 0.50 0.00
borderstyle "NONE"
shader "paper"
}
resource
Label
{
name "Default"
rect 0 0 256 256
fgcolor 1.00 1.00 1.00 1.00
bgcolor 0.50 0.50 0.50 0.00
borderstyle "NONE"
shader "paper"
}
resource
Label
{
name "Default"
rect 0 0 640 480
fgcolor 1.00 1.00 1.00 1.00
bgcolor 0.50 0.50 0.50 0.00
borderstyle "NONE"
shader "shadow"
}
resource
Label
{
name "Default"
rect 0 0 640 480
fgcolor 1.00 1.00 1.00 1.00
bgcolor 0.50 0.50 0.50 0.00
borderstyle "NONE"
shader "wrinkles"
}
resource
Label
{
name "Default"
rect 80 32 480 368
fgcolor 1.00 1.00 1.00 1.00
bgcolor 1.00 1.00 1.00 0.00
borderstyle "NONE"
shader "white"
}
resource
Label
{
name "Default"
rect 80 32 480 368
fgcolor 1.00 1.00 1.00 1.00
bgcolor 1.00 1.00 1.00 0.00
borderstyle "NONE"
shader "sepiaoverlay"
}
resource
Label
{
name "Default"
rect 96 48 448 336
fgcolor 1.00 1.00 1.00 1.00
bgcolor 1.00 1.00 1.00 0.00
borderstyle "NONE"
shader "mydmloadingscreen" // <--- should match your shader name (1st line of code in your shader file, not the shader's filename)
}
resource
Label
{
name "Default"
rect 76 28 64 64
fgcolor 1.00 1.00 1.00 1.00
bgcolor 1.00 1.00 1.00 0.00
borderstyle "NONE"
shader "ul_corner"
}
resource
Label
{
name "Default"
rect 500 28 64 64
fgcolor 1.00 1.00 1.00 1.00
bgcolor 1.00 1.00 1.00 0.00
borderstyle "NONE"
shader "ur_corner"
}
resource
Label
{
name "Default"
rect 500 340 64 64
fgcolor 1.00 1.00 1.00 1.00
bgcolor 1.00 1.00 1.00 0.00
borderstyle "NONE"
shader "lr_corner"
}
resource
Label
{
name "Default"
rect 76 340 64 64
fgcolor 1.00 1.00 1.00 1.00
bgcolor 1.00 1.00 1.00 0.00
borderstyle "NONE"
shader "ll_corner"
}
resource
Label
{
title "LOADING SCREEN TITLE" // <-- loading title text
name "Default"
rect 72 408 496 32
fgcolor 1.00 1.00 1.00 1.00
bgcolor 0.00 0.00 0.00 0.00
borderstyle "NONE"
font facfont-20
}
end.
in notepad save as "all files" mymapname.urc (how you call on your map in-game which is determined by your mymapname.bsp)
put this .urc file in the *\ui\ folder.
That should do it. if it doesn't work right away, take my map's pk3 as reference, check the .shader and .urc files with yours.
now, to get this loading screen also as your scoreboard pic, do the following:
open notepad again, paste the following code and edit
Code: Select all
main:
// set scoreboard messages
setcvar "g_obj_alliedtext1" "welcome to"
setcvar "g_obj_alliedtext2" "Map awesome map"
setcvar "g_obj_alliedtext3" "gametypes"
setcvar "g_obj_axistext1" "---------------"
setcvar "g_obj_axistext2" "created by me"
setcvar "g_obj_axistext3" "version 1.2.3"
setcvar "g_scoreboardpic" "mydmloadingscreen" // <<- the shader name again
level waittill prespawn
//*** Precache Dm Stuff
exec global/DMprecache.scr
level.script = maps/dm/mymapname.scr
level waittill spawn
end
this .scr file is the file that you use for scripting, make stuff move around, create an objective, call other scripts etc.
3. xfire is just a game server browser, you can chat with other people and join their server etc
Re: how to play a map i created
thanks so much,
yet another problem appears .. as i add some more details to the map textures began to corrupt like so : and so any idea why ?
yet another problem appears .. as i add some more details to the map textures began to corrupt like so : and so any idea why ?
-
BatteryAziz
- Moderator
- Posts: 82
- Joined: Tue Jun 15, 2010 4:44 pm
Re: how to play a map i created
i suppose you're not caulking yet. caulking means making every brush in your map caulk (type utility, it's the green/pink one). caulk itself is a structural "no-draw" texture. then you ONLY texture the sides of the brushes that the player can actually see. this way you drastically reduce the amount of drawn "faces" (sides of all brushes) in-game. the compiler can get confused if there are too many structural faces (that is, they would affect VIS) and the compiler starts to leave them out randomly.
so first thing you do is: make ALL of your brushes caulk. Then paint only the visible sides with the desired texture.
- full brush select = shift + click (as you know)
- select only sides of a brush = ctrl + shift + click
secondly, let's start making the detailed little things actually "detail" as opposed to structural. the easiest rule to distinguish what to make/keep structural and what to make detail:
- walls, floors, roofs = STRUCTURAL (select said brushes, and press ctrl + alt + D)
- complex brushes, stairs, things that don't block the view, etc. (basically everything other than walls, floors, roofs) = DETAIL (select said brushes, and press ctrl + shift + D)
in your 2D view you will notice the structural brushes are black, and the detail brushes now appear green.
use filters to facilitate this process (makes it easier to see if you've left something out).
(note that filters only toggle the view of things on/off in mohradiant, they don't actually remove anything.)
ctrl + D = leaves out detail brushes
alt + 1 = leaves out structural brushes
also handy to leave out sometimes:
alt + 2 = entities (includes static models, not lights)
alt + 0 = lights
alt + 3 = patches
ctrl + R = lod terrain
now, if your map has grown a bit, and has some corridors and seperate rooms, you can remove the -fast command from VIS Options in mbuilder. you'll then notice the vis stage taking a little longer. if your structural/detail choices are done correctly, it will only take a few minutes. try it out so you can see the difference to your fps in-game.
so first thing you do is: make ALL of your brushes caulk. Then paint only the visible sides with the desired texture.
- full brush select = shift + click (as you know)
- select only sides of a brush = ctrl + shift + click
secondly, let's start making the detailed little things actually "detail" as opposed to structural. the easiest rule to distinguish what to make/keep structural and what to make detail:
- walls, floors, roofs = STRUCTURAL (select said brushes, and press ctrl + alt + D)
- complex brushes, stairs, things that don't block the view, etc. (basically everything other than walls, floors, roofs) = DETAIL (select said brushes, and press ctrl + shift + D)
in your 2D view you will notice the structural brushes are black, and the detail brushes now appear green.
use filters to facilitate this process (makes it easier to see if you've left something out).
(note that filters only toggle the view of things on/off in mohradiant, they don't actually remove anything.)
ctrl + D = leaves out detail brushes
alt + 1 = leaves out structural brushes
also handy to leave out sometimes:
alt + 2 = entities (includes static models, not lights)
alt + 0 = lights
alt + 3 = patches
ctrl + R = lod terrain
now, if your map has grown a bit, and has some corridors and seperate rooms, you can remove the -fast command from VIS Options in mbuilder. you'll then notice the vis stage taking a little longer. if your structural/detail choices are done correctly, it will only take a few minutes. try it out so you can see the difference to your fps in-game.
Re: how to play a map i created
"caulk" and "blank_lightmap" look the same. make sure you select "caulk.
-
BatteryAziz
- Moderator
- Posts: 82
- Joined: Tue Jun 15, 2010 4:44 pm
Re: how to play a map i created
good one, same as "static_visible". those only come up when browsing using textures -> common however, not when searching by keyword "utility".
-
BatteryAziz
- Moderator
- Posts: 82
- Joined: Tue Jun 15, 2010 4:44 pm
Re: how to play a map i created
following up on my previous post. this is one way to do a proper hatch 
the following code will have you open the hatch, and will close by itself only if a player is far enough removed from the hatch's origin (like how a door works and closes by itself).
note:
if you want a hatch that STAYS open until you press "use" again, scroll down to the second bit of [/code] and use that (maybe a good idea to start off with something simple first :p ).
now, this particular method may seem a little bothersome at first. admittedly you could also simply use a trigger_multipleall (targetname/myhatch_triggermulti) around the hatch, and keep the hatch open until all players leave the trigger using "while (local.player istouching $myhatch_triggermulti) ". however i had less luck doing it this way myself (sometimes it would still close randomly, don't know why), and with the local.prox method it's easier to adjust the distance to your liking, without having to recompile your entire map.
******
if you'd like to keep the hatch open indefinitely, until you press "use" again to close it, simply use this piece of code (way simpler now that i think of it :p )
the following code will have you open the hatch, and will close by itself only if a player is far enough removed from the hatch's origin (like how a door works and closes by itself).
note:
if you want a hatch that STAYS open until you press "use" again, scroll down to the second bit of [/code] and use that (maybe a good idea to start off with something simple first :p ).
Code: Select all
// make a hatch with origin brush, make it a script_object, give it targetname myhatch1
// make a trigger_use and place it appropriately, give it targetname myhatch1_triggeruse
// put this piece of code after the first "end" in your mymapname.scr file
// put a "thread hatch1" (without "") BEFORE level waittill spawn, that will execute this thread
hatch1:
local.prox = 100 // max units of distance between player and hatch
while(1)
{
$myhatch1_triggeruse waittill trigger // wait until trigger is used
if(level.hatch1_closed == 1) // only execute when hatch is unopened (just a safeguard)
{
level.hatch1_closed = 0
$myhatch1 playsound snd_hatch_open // plays sound alias, more on this later
$myhatch1 time 2 // do the movement in 2 seconds time
$myhatch1 rotatexup 90 // rotate around x-axis (else use rotateyup)
$myhatch1 waitmove // execute above movement(s) in given timeframe
local.player = parm.other
local.player_x = local.player.origin[0]
local.player_y = local.player.origin[1]
local.player_z = local.player.origin[2] - 83 // use z-coordinates of player's feet instead of head
local.hatch_x = $myhatch1.origin[0]
local.hatch_y = $myhatch1.origin[1]
local.hatch_z = $myhatch1.origin[2]
// initial distance between hatch and player
local.hatchvec = ( (local.hatch_x - local.player_x) (local.hatch_y - local.player_y) (local.hatch_z - local.player_z) )
local.hatchvec_x = abs ( local.hatchvec[0] )
local.hatchvec_y = abs ( local.hatchvec[1] )
local.hatchvec_z = abs ( local.hatchvec[2] )
// loop this if the player is within "local.prox" distance of hatch
while( (local.hatchvec_x < local.prox) && (local.hatchvec_y < local.prox) && (local.hatchvec_z < local.prox) )
{
wait 1
// update distance between hatch and player
local.player = parm.other
local.player_x = local.player.origin[0]
local.player_y = local.player.origin[1]
local.player_z = local.player.origin[2] - 83
local.hatchvec_x = abs ( local.hatchvec[0] )
local.hatchvec_y = abs ( local.hatchvec[1] )
local.hatchvec_z = abs ( local.hatchvec[2] )
}
// close the hatch again
$hatch1 playsound snd_hatch_close
$hatch1 time 2
$hatch1 rotatexdown 90
$hatch1 waitmove
level.hatch1_closed = 1
}
waitframe
}
end
//to make the hatch sound work, put this AFTER level waittill spawn (without the // of course)
//local.master = spawn ScriptMaster
//local.master aliascache snd_hatch_open sound/mechanics/DoorWoodOpen_07.wav soundparms 1.0 0.2 1.0 0.2 200 2000 auto loaded maps "obj dm"
//local.master aliascache snd_hatch_close sound/mechanics/DoorWoodOpen_05.wav soundparms 1.0 0.2 1.0 0.2 200 2000 auto loaded maps "obj dm"
//note:
//sound/mechanics/DoorWoodOpen_07.wav etc are just my pick, you can browse pak3.pk3 to pick something else
******
if you'd like to keep the hatch open indefinitely, until you press "use" again to close it, simply use this piece of code (way simpler now that i think of it :p )
Code: Select all
// make a hatch with origin brush, make it a script_object, give it targetname myhatch1
// make a trigger_use and place it appropriately, give it targetname myhatch1_triggeruse
// put this piece of code after the first "end" in your mymapname.scr file
// put a "thread hatch1" (without "") BEFORE level waittill spawn, that will execute this thread
hatch1:
while(1)
{
$myhatch1_triggeruse waittill trigger // wait until trigger is used
if(level.hatch1_closed == 1) // only execute when hatch is unopened (just a safeguard)
{
level.hatch1_closed = 0
$myhatch1 playsound snd_hatch_open // plays sound alias, more on this later
$myhatch1 time 2 // do the movement in 2 seconds time
$myhatch1 rotatexup 90 // rotate around x-axis (else use rotateyup)
$myhatch1 waitmove // execute above movement(s) in given timeframe
$myhatch1_triggeruse waittill trigger // again, wait until trigger is used
// close the hatch again
$hatch1 playsound snd_hatch_close
$hatch1 time 2
$hatch1 rotatexdown 90
$hatch1 waitmove
level.hatch1_closed = 1
}
waitframe
}
end
//to make the hatch sound work, put this AFTER level waittill spawn (without the // of course)
//local.master = spawn ScriptMaster
//local.master aliascache snd_hatch_open sound/mechanics/DoorWoodOpen_07.wav soundparms 1.0 0.2 1.0 0.2 200 2000 auto loaded maps "obj dm"
//local.master aliascache snd_hatch_close sound/mechanics/DoorWoodOpen_05.wav soundparms 1.0 0.2 1.0 0.2 200 2000 auto loaded maps "obj dm"
//note:
//sound/mechanics/DoorWoodOpen_07.wav etc are just my pick, you can browse pak3.pk3 to pick something else