SCRIPTING

Post your scripting questions / solutions here

Moderator: Moderators

Guest

SCRIPTING

Post by Guest »

:roll:
OK, regarding scripting. i don't understand it. how do you know what to type in a script, it confusing to me
Innkeeper
Colonel
Posts: 475
Joined: Mon Nov 25, 2002 10:13 pm
Location: NC, USA (about 7.5 klicks from the capital dome)
Contact:

Post 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.
(CG) Bob III

Post 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.
User avatar
General Death
Moderator
Posts: 1116
Joined: Thu Nov 21, 2002 2:33 am
Location: NC, USA
Contact:

Post 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.
Image
Guest

Post by Guest »

what is a precache.scr......do you need it or just the regular .scr?
User avatar
mohaa_rox
Field Marshal
Posts: 2760
Joined: Mon Nov 11, 2002 7:05 am
Contact:

Post 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.
Live to map, not map to live.
-mohaa_rox, .map
moderator
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post 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.
Image
(CG) Bob III
Lance Corporal
Posts: 24
Joined: Sun Jan 12, 2003 9:04 pm

Post 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?
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post by jv_map »

2nd.

If the script is in the right folder with the right name, the game will use it.
Image
Angex
Major
Posts: 293
Joined: Mon Dec 30, 2002 1:23 pm
Contact:

Post 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.
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post 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.
Image
Innkeeper
Colonel
Posts: 475
Joined: Mon Nov 25, 2002 10:13 pm
Location: NC, USA (about 7.5 klicks from the capital dome)
Contact:

Post 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. :)
Angex
Major
Posts: 293
Joined: Mon Dec 30, 2002 1:23 pm
Contact:

Post 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
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post 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.
Image
Gargoyle
Lance Corporal
Posts: 24
Joined: Mon Jan 13, 2003 7:34 pm
Location: Oregon

Post by Gargoyle »

I'm lost! lol
And you thought dragons were scary.....
Image
Post Reply