OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: shadow99 on 07 Jul 2004, 04:56:15
-
Yes! It's not really all that difficult, is it? Anyway, the question is, when I begin a script during the night, the camera automatically has night vision, how do I take it off?
Thanks!
-
It does? :o
That's news to me, I'm gonna give it a whirl. :)
Though I don't have an answer to your Q.
-
Okay, this is driving me complete nuts. First was the night vision problem, but now when I export this mission to single player missions, the intro camera script (intro.sqs) will NOT start.
In the intro, all you can see is a nightvision third person view of the player (Black Op).
In the preview of the intro through the mission editor, all is well, it just doesn't make sense why it doesn't work in a single player intro.
Also, I can't get the trigger to work to end the intro.
The trigger is simply default, except for:
Type: End#1
Condition: endcut
Yes, I have 'endcut' at the end of my camera script, and it doesn't even end in the preview through the mission editor.
*Scratches head*
AHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA!!!!!!!!!!!!!!!!!!!
-
The nightvision is on, because the player unit in your intro has nv goggles...
Remove them and that removes that problem...
The endcut in your script needs to be endcut=true...
Can't help much if you don't actually let us see the script of yers...
You still need to execute the intro.sqs from someplace, [] exec "intro.sqs"...
It won't run automatically...
-
Yeh, me knows I need to execute it...
Thanks for the nightvision clue though, I suspected it would be that. The only reason I haven't acted upon that assumption is because I have no idea how to take away the NV goggles. Thanks for your answers.
-
Right. Remove all weapons command should do the trick...
-
In intro, it doesn't change much if you change the "player" unit to some another unit, what doesn't have NV googles. Examble make normal soldier the player unit, it doesn't change anything dramatically.
-
Do have the camera created at the start of you script???
As I said, needs to see that script... ::)
-
As with the others can't deduce much else without seeing the script but it sounds like the script itself simply isn't executing. What are you usign to execute the script? Have you placed it in the OnActivation field of a trigger? A units init field?
Btw i have experienced something when executing the scirpt for an intro, for some reason when i use []exec "intro.sqs" in the players init field the script doesn't execute, however if i use this exec "intro.sqs" it does work. Try that.
-
Don't know what was wrong, but everything is fine now.
-
I don't know Acid, I didn't get your message until after the problem was fixed because I was in the typing-post screen. But I just moved things around a bit in the intro.sqs and everything worked out. I think taking off the night vision helped, actually.
But I'll keep in mind 'this exec "intro.sqs". Thanks for that.
-
Oh, ok...
Good you got it sorted...
[] and this don't matter when executing a script that has nothing that is passed in it at the moment of executing..
[this] exec "script.sqs" means it's an array that executes a script, and the first element in that array is called with _variable = _this select 0
As for this exec "script.sqs" the this is passed into the script 'arrayless' so it's called in the script simply _variable = _this
So that problem when script is not executing when called with [] exec "script.sqs" is caused by something else...
You should actually be able to execute a script that has nothing passed in it with ""exec"script.sqs"...
Widely off-topic and hopefully very confusing :P ;D
-
Accomplished, Klint. ;)
-
Like i said though, that doesn't always work. I already knew about the differences of [] and this and setting variables etc etc i've been scripting ever since OFP came out, my point is simply i was saying that in the players init filed when executing an intro i've found the game sometimes won't execute the script unless you use this instead of [].
-
Okay, this is driving me complete nuts. First was the night vision problem, but now when I export this mission to single player missions, the intro camera script (intro.sqs) will NOT start.
The thing to remember here is the difference between the intro section of the editor and the mission section of the editor.
In the mission section, your init.sqs will run automatically at the start of the mission.
However in the intro section, you'd need a script called initintro.sqs if you wanted to have the same effect in that situation ;)
As for the [] vs this... don't ask me. I've never had any problems with either. As far as I know, it shouldn't make a difference unless you have a condition at the start of the script which exits on condtion of an arguement or something...