Hi all,
Firstly, I am getting somewhat aware of how things work regarding sounds, tik files etc., and DO UNDERSTAND that MOHAA does not
allow a lot of things to get loaded and cached for Single User Maps.
I have read through and downloaded the tutorials by Surgeon etc., on
the how to get some things to work regarding sounds for instance.
But as you folks know, to get all the is required, most of us end up
prefixing our maps with "test_" so that all the AI actions etc., will work.
OK. That being said, with the understanding there is still a lot of things
I simply have no knowledge about....... what I would like to know is
if anyone can show me (other newbies) a map_name.scr file that
contains all the "required global commands, and I will call them directive
type program code statements ...........that.............will allow whatever
is put into the main portion or in methods or threads in the main startup
script file, to work without error messages...........once the main script
file is ran.
Put another way.
What should I have in my map_name.scr file when I name it:
test_mymap.scr instead of just mymap.scr?
Things I am putting in the file do not seem to be activated, just for instance, a command like:
$player item weapons/colt45 WILL NOT give the player the weapon once the player is spawned, IF I run the map as a test map........e.g.
map test_mymap. HOWEVER, IF I RUN AN IDENTICAL MAP CALLED:
mymap of course having a duplicate mymap.scr file the player will
get the weapon assigned.
It appears that if I run the test_ version of the map, things do not get interpreted correctly or ignored or I get some type of error when the
engine tries to read the stuff placed in the script file.
Sorry for the long winded statements, I just want to attempt to be clear on what I am experiencing. IF I AM NOT MAKING SENSE TO ANYONE THAT MIGHT BE WILLING TO HELP ME, please say so and I will try to re-word what I have said here.
In summary, if I run two identical map.scr files..........where one is
grb.scr and the second is test_grb.scr.
The Player will get weapons assigned when running the grb.scr version,
but not when I run the test_grb.scr version. YES of course I have to identical map files one being grb.bsp the other test_grb.bsp etc..
I am open for dialog via. email if this is simpiliar to explain by that method.
Thank you in advance for any help.
Need help with basic script file contents for SP maps
Moderator: Moderators
well, all the script files for exec/global are in one of the original pk3s under 'global' and they all have info inside them. To enable them, for example 'friendly' script, after 'main:' in the script write the exec/global stuff then add the 'friendly' stuff.
like:
exec global/friendly.scr //to enable your friendly commands to work
exec global/bomber.scr //to enable the planes to work
Hope this helps
like:
exec global/friendly.scr //to enable your friendly commands to work
exec global/bomber.scr //to enable the planes to work
Hope this helps
PFC.Butch
B Company, 2nd Ranger Battalion
US Army
B Company, 2nd Ranger Battalion
US Army
Thanks Butch
Thanks Butch,
I will try to insert the globals scripts as you indicted. Actually I did have a few of them placed PRIOR to the "main" statement, such as ai.scr just to
name one. I will look through the various global script files found in Pack 0, which is where I think they are located. I had unziped PK0 pack to a subdir so that I could see what is in all that pack.
I did figure out how to give the player all the weapons and ammo I wanted him to have by making a multiple trigger and put a:
KEY: setthread
Value: name of a thread that I put into the test_mymap.scr file I am running.
So all I do is walk a foot or so over the trigger and bingo I get the weapons etc..
But it just seems cleaner to have the weapons and ammo assigned within the main script program once other things are initiated.
Thanks again for the help.
I will try to insert the globals scripts as you indicted. Actually I did have a few of them placed PRIOR to the "main" statement, such as ai.scr just to
name one. I will look through the various global script files found in Pack 0, which is where I think they are located. I had unziped PK0 pack to a subdir so that I could see what is in all that pack.
I did figure out how to give the player all the weapons and ammo I wanted him to have by making a multiple trigger and put a:
KEY: setthread
Value: name of a thread that I put into the test_mymap.scr file I am running.
So all I do is walk a foot or so over the trigger and bingo I get the weapons etc..
But it just seems cleaner to have the weapons and ammo assigned within the main script program once other things are initiated.
Thanks again for the help.
grb
well i need to ask you some questions first...
do you use a 'developer' shortcut? thereisnomonkey, blah blah...
for one thing, you have to put $player item weapons/colt45.tik
before you start the map, type logfile 2 in your console. this will log everything the game puts in your console. load the map, do whatever your trying to test out, then quit the game. look for qconsole in your /main folder and post it.
do you use a 'developer' shortcut? thereisnomonkey, blah blah...
for one thing, you have to put $player item weapons/colt45.tik
before you start the map, type logfile 2 in your console. this will log everything the game puts in your console. load the map, do whatever your trying to test out, then quit the game. look for qconsole in your /main folder and post it.
loadout
Look at the scripts named, "loadout_precache.scr" and "loadout.scr". The weapons for each singleplayer map are set with them. The line in your script that will activate one of them would look like this:
exec global/loadout.scr maps/m4l0.scr
exec global/loadout.scr maps/m4l0.scr
Thanks guys for the help...
Alchoholic..................
Yes I do have all the stuff you mentioned plus more in the ICON shortcut.
I have been using the logfile to analyis what is happening/not happening.
I disliked the idea of downloading huge chunks of logfile until I ran out of
possible fix. Yes I had included the code lines for giving the player various
items and weapons (in the correct syntax) as you indicate in your response. For example: $player item weapons/colt45.tik.
tltrude......................
I will look at the contents of the mentioned script files "loadout_precache.scr" and "loadout.scr". And see what they contain.
As I indicated in my original question/statement. When I put those weapon/item assignment statement lines into a thread outside the main program BUT within the same script program like this:
main:
blah
blah
blah
end
GiveWeapons:
$player item weapons/colt45.tik
...
...
end
And then create a trigger in the map that points to this thread, then walk over the trigger while in the game..........bingo I get all weapons assigned
correctly. So I do not think it is an issue of not having the proper script files being loaded when running a test type map/script verse running the same map and equivalent script file (of course I also have a precache script file ....named correctly to represent each version .... e.g.
grb1.scr or test_grb1.scr)
The problem was where when I run my SP map/script called grb1.scr
the with the weapon assingment statements buried in the main program,
the weapons get assigned immediately after the player gets spawned into the game. But if copied the script file called grb1.scr to test_grb1.scr and
run it...............the weapons do not get assigned to the player, even though I see the temporary weapon window pop up at the bottom of the screen, no weapons got assigned. So that is when I modified the test_grb1.scr version so that it has a thread outside the main program to asssign the weapons, and gets fired by the multiple-trigger.
-----------------------------------
So the above being the case. Let me ask you all the following question.
When one runs a script file (of course with corresponding name compliant
pre-cache script file......e.g. test_doit.scr test_doit_precache.scr),
should one expect ALL the scripts files found in all the Packs be loaded into system memory? And if the answer is yes to this question, then
why would we have problems with weapons/items/player AI etc., not
working correctly or at all? I realize this could be considered a "loaded
question". I am not trying to be cute or cleaver etc., just trying to get a better idea as how things work.
Thanks for any further comment, help by any reader of this thread.
Yes I do have all the stuff you mentioned plus more in the ICON shortcut.
I have been using the logfile to analyis what is happening/not happening.
I disliked the idea of downloading huge chunks of logfile until I ran out of
possible fix. Yes I had included the code lines for giving the player various
items and weapons (in the correct syntax) as you indicate in your response. For example: $player item weapons/colt45.tik.
tltrude......................
I will look at the contents of the mentioned script files "loadout_precache.scr" and "loadout.scr". And see what they contain.
As I indicated in my original question/statement. When I put those weapon/item assignment statement lines into a thread outside the main program BUT within the same script program like this:
main:
blah
blah
blah
end
GiveWeapons:
$player item weapons/colt45.tik
...
...
end
And then create a trigger in the map that points to this thread, then walk over the trigger while in the game..........bingo I get all weapons assigned
correctly. So I do not think it is an issue of not having the proper script files being loaded when running a test type map/script verse running the same map and equivalent script file (of course I also have a precache script file ....named correctly to represent each version .... e.g.
grb1.scr or test_grb1.scr)
The problem was where when I run my SP map/script called grb1.scr
the with the weapon assingment statements buried in the main program,
the weapons get assigned immediately after the player gets spawned into the game. But if copied the script file called grb1.scr to test_grb1.scr and
run it...............the weapons do not get assigned to the player, even though I see the temporary weapon window pop up at the bottom of the screen, no weapons got assigned. So that is when I modified the test_grb1.scr version so that it has a thread outside the main program to asssign the weapons, and gets fired by the multiple-trigger.
-----------------------------------
So the above being the case. Let me ask you all the following question.
When one runs a script file (of course with corresponding name compliant
pre-cache script file......e.g. test_doit.scr test_doit_precache.scr),
should one expect ALL the scripts files found in all the Packs be loaded into system memory? And if the answer is yes to this question, then
why would we have problems with weapons/items/player AI etc., not
working correctly or at all? I realize this could be considered a "loaded
question". I am not trying to be cute or cleaver etc., just trying to get a better idea as how things work.
Thanks for any further comment, help by any reader of this thread.
grb
Butch, tltrude, Alcoholic, bdbodger.....thanks for help....
I got the weapons and items to load upon initial map load. After I added
the exec friendly, loadout_precache, loadout etc., global scripts at the top
of my map script file, then put all the $player item weapons/blah...
under main:
Now all weapons/items spawn into game for player.
As far as bdbodger suggestion, I might try it anyway, just to see what it would do.
Lastly, I still have a lot of questions concerning how and when to use the global files, making Allied AI bots follow player etc.. I hate to just ask on the fly without giving things my best shot. So I guess in fairness to all helpers in this thread, lets consider this thread CLOSED. PROBLEM SOLVED.
Thanks again for all your help.
the exec friendly, loadout_precache, loadout etc., global scripts at the top
of my map script file, then put all the $player item weapons/blah...
under main:
Now all weapons/items spawn into game for player.
As far as bdbodger suggestion, I might try it anyway, just to see what it would do.
Lastly, I still have a lot of questions concerning how and when to use the global files, making Allied AI bots follow player etc.. I hate to just ask on the fly without giving things my best shot. So I guess in fairness to all helpers in this thread, lets consider this thread CLOSED. PROBLEM SOLVED.
Thanks again for all your help.
grb
bdbodger and mohaa_rox....
bd,
Your suggestion to try "Give Weapons", seen earlier in this threaa did not
work. But thanks anyway for the effort. As you will notice, just prior to your suggestion, I indicated that I did get the weapons to be assigned after moving command statements around in the script file.
mohaa_rox,
Where can I find examples of your Spyhard script file(s)?
Clearly, at this point I must spend time examining well written scripting commands, which
are syntatically correct and placed in the proper places within the script file. To many examples I am seeing in these forum threads, seem to deviate from some "fixed" order of where a given line of code gets placed.
thanks in advance for any further feedback.
Your suggestion to try "Give Weapons", seen earlier in this threaa did not
work. But thanks anyway for the effort. As you will notice, just prior to your suggestion, I indicated that I did get the weapons to be assigned after moving command statements around in the script file.
mohaa_rox,
Where can I find examples of your Spyhard script file(s)?
Clearly, at this point I must spend time examining well written scripting commands, which
are syntatically correct and placed in the proper places within the script file. To many examples I am seeing in these forum threads, seem to deviate from some "fixed" order of where a given line of code gets placed.
thanks in advance for any further feedback.
grb
