Page 1 of 2
SCRIPTING
Posted: Fri Jan 03, 2003 4:28 am
by Guest
OK, regarding scripting. i don't understand it. how do you know what to type in a script, it confusing to me
Posted: Fri Jan 03, 2003 5:16 am
by Innkeeper
Scripting is like a programming language. There is a syntax that is used, some of which is like "C". (boy I know I wiil be flamed

for sure). There might be some generic scripting tutorials somewhere. I'm not sure where. Scripts control the events that take place in the game. Such as giving a player weapons.
What is it you want to do. Maybe we can help.
Posted: Sun Jan 12, 2003 9:00 pm
by (CG) Bob III
hope nobody minds if i jump in -- heh. when i write a script [mapname].scr or [mapname]_precache.scr, where do i put the .scr so the level actually uses it? do you need it in the same folder as the .map file when you compile it? or do you put it in the mohaa/main/maps folder with the compiled map? or somewhere else?
a sepparate question: can you use the script to load ubersound from the preexisting mohaa file structure, or do you need another copy? someone said that putting an ubersound with the map made it hostile to other maps or something - basically it should be avoided if possible.
Posted: Mon Jan 13, 2003 12:10 am
by General Death
hope nobody minds if i jump in -- heh. when i write a script [mapname].scr or [mapname]_precache.scr, where do i put the .scr so the level actually uses it? do you need it in the same folder as the .map file when you compile it? or do you put it in the mohaa/main/maps folder with the compiled map? or somewhere else?
Goes in the same folder as the .bsp file....Its not needed before compiling.
Posted: Mon Jan 13, 2003 7:00 am
by Guest
what is a precache.scr......do you need it or just the regular .scr?
Posted: Mon Jan 13, 2003 8:23 am
by mohaa_rox
Actually, I don't use precache. I think there's not a need for it. Many models are in maps, so it'll would be KILLING trying to cache everything.
Posted: Mon Jan 13, 2003 3:08 pm
by jv_map
You shouldn't load all models with the precache file. It's main task is to prefetch models that are dynamically spawned during the game. Adding the necessary model to the precache script would prevent a minor slow down when spawning the TIKI the first time.
Posted: Fri Jan 17, 2003 1:22 am
by (CG) Bob III
ok, how bout how do you get the game to recognize the script files and actually use them? is ther some option that needs to be set somewhere, or should the game just go looking for a [mapname].scr file in the same folder as the compiled .bsp?
Posted: Fri Jan 17, 2003 7:21 am
by jv_map
2nd.
If the script is in the right folder with the right name, the game will use it.
Posted: Fri Jan 17, 2003 12:40 pm
by Angex
I've found that it can also help if you cache some of the scripts used in your map. For instance I was working through the "MG with spotter" tutorial, where they spawned right at the start of the map. I noticed that the first time they spawned, the game would almost freeze, while it was running through the global/mg42.scr . So I added the script to my precache script and the map ran alot better.
Posted: Fri Jan 17, 2003 1:59 pm
by jv_map
I don't think you can precache a script

.
Also, all scripts in the global folder are automatically pre-compiled when loading the map, regardless of they're used or not.
Posted: Fri Jan 17, 2003 2:27 pm
by Innkeeper
jv_map wrote:Also, all scripts in the global folder are automatically pre-compiled when loading the map, regardless of they're used or not.
Hmmm... That is intresting to know.

Posted: Fri Jan 17, 2003 4:12 pm
by Angex
Ah, my mistake, I think you are correct. But what is this line for, if it's not precaching a script:
exec global/loadout_precache.scr maps/mapname.scr
Posted: Fri Jan 17, 2003 5:53 pm
by jv_map
It will precache the weapon models that the original developers used in the map supplied. So it only works if you provide a map name from the original game, otherwise it just does nothing at all.
Posted: Fri Jan 17, 2003 6:53 pm
by Gargoyle
I'm lost! lol