OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: repta on 30 Jul 2004, 16:01:40
-
hey i have a few questions.
1)how do i get ammo crates in the game. I use chris' crate wizard but i cant get it in the game. i do all of the initializing w/e. plus i cant find an ammo crate in the editor
2)i made some custom soldiers in his soldier maker and i cant get them into the game. I am doing all of this for a freeroaming coop map.
thanx in advance
-
1. Errr, to insert an ammo crate
Side: Empty
Class: Ammo
You have to create a player unit first.
-
i did that. but when i go to it it's just the standard crate(grenades). i did the correct initializing stuff and the crate is in the same folder. i dont care about the soldier right now.
-
these are the stats:
2 playable charachters(both east)
ammo crate(east)
side:empty
class:ammo
int: [this] exec "CUSTOM_CRATE.sqs"
what could be wrong
-
Are you sure the script should be executed that way? Mabey it needs to be executed with:
this exec "CUSTOM_CRATE.sqs"
And are you sure there's something actually in the script?
-
still doesnt work. i looked at the script and there is stuff in it, but i dont kno script at all(new to ofp). maybe u could look at it.
-
...in the same folder...
What folder? Where? What?
If the script is in a folder inside the mission folder, you need to exec it with the correct path.
-
it is in the same folder as the mission
-
1. What is the name of the script in your mission folder?
2. What code do you use to call it?
If the names aren't the same, it won't work.
-
If the script is in the same folder as the mission.sqm then it should be found.
Double check the spelling in the init line for the script is exactly the same as the name of the script file.
Should be:
this exec "nameofscript.sqs"
As has been previously stated.
I don't think [this] exec "nameofscript.sqs" will work.
[this] refers to an array I believe.
Planck
-
the name of the script is CUSTOM_CRATE.sqs
i have tried it with and without the "[]" and it still doesnt work.
-
OK......what did you save your .sqs file with?
If it was Notepad, you need to save it as All File type from the save requester, not as text type.
Failure to do this results in a file called nameofscript.sqs.txt.
You won't notice this if you have 'Hide file extensions for known files' ticked in your folder preferences.
Planck
-
as i said earlier i used chris' crate wizard
-
Try opening up your script file in Notepad and copy/paste it into a fresh Notepad document.
Save as Type 'All Files', and give it the name you want.
Planck
-
why not just learn how to do it yourself? much easier i think
all you need to know is:
this addweapon cargo ["m16",5]
this addmagazinecargo ["m16",5]
m16 being the weapon or magazine and the 5 being the number of weapons or magazines you are putting in that crate.
-
i have many items in my crate and i dont want to go and type it in. any ways i rewrite the script on notepad and it still doesnt work(extentions were not hidden). i saved it as a ext. how do u guys get scripts to work? they dont like me very much.
-
Try this:
[this] exec "my_cratenamechanged.sqs"
in the init field of the crate. If that works, read SnYpirs introduction to Code Snippets in Editors Depot.
:beat: *Gets Shot* :beat:
EDIT: Whoa! Don't save as ext, then itll crash! .sqs is your file!
-
that is exactly what ive been doing. i did it again and it still wont work.
-
Zip your script and post it here so we can download it and see.
Planck
-
here it is
-
OK
I made a quick thing in the mission editor.
I placed the 'Ammo Crates (West)' and myself as player on the Intro Isle.
I saved it then Alt Tabbed out of the game and then put a copy of your script in the mission folder where the mission.sqm was.
Back in the game I put:
[this] exec "custom_crate.sqs"
in the init field of the crate.
In this particular case it required '[this]' and not 'this'.
Everything worked just fine, I went to the crate and could choose all sorts of weapons.
I also tried it with 'Ammo Crates (East)'.
Planck
-
okay, it worked on the empty map but when i did it on my map it said ""chat.sqs" not found!"
-
What does chat.sqs have to do with custom_crate.sqs?
Planck
-
dont ask me
-
Well......it is your mission, you should know if you are calling a script callled 'chat.sqs' from anywhere or not.
Maybe you should post your mission so we can look.
Planck
-
nvm, i figured it out.
-
Eh?
In the code
RUN CODE: [this] Exec "CUSTOM_CRATE.sqs"
::)
- Ben
-
i figured it out.
-
Thats good news.
How about pressing the 'solved' button.
Planck