OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: Alex on 22 Jan 2006, 12:47:08

Title: Intro Problems
Post by: Alex on 22 Jan 2006, 12:47:08
Hi all, I am having problems with my intro, this is it so far...

Code: [Select]
titlecut [" ","BLACK IN",3]

enableradio false

_cam = "camera" camcreate [0,0,0]
_cam cameraeffect ["internal", "back"]


; and ... action!

_cam camsettarget logic1
_cam camsetrelpos [-80,100,7]
_cam camcommit 0
@camcommitted _cam

~2

titlecut ["RFK Assassination Project","plain down",2]

~2

; start the camera moving

_cam camsettarget logic1
_cam camsetrelpos [-35,-25,5]
_cam camcommit 10
@camcommitted _cam


titlecut ["Created By Alex","plain down",2]

_cam camsettarget logic1
_cam camsetrelpos [0,-10,3]
_cam camcommit 15
@camcommitted _cam


titlecut ["","plain down",2]

_cam camsettarget logic1
_cam camsetrelpos [7,-7,3]
_cam camcommit 6
@camcommitted _cam

~4


titlecut ["","BLACK OUT",2]

~5

; tidy up and exit

_cam cameraeffect ["terminate", "back"]
camdestroy _cam

enableRadio true

exit

Ok, now with this i have a boat come in and land, just as it hits shore the fade kicks in, this is what i want. I now want to delete the boat some how and have troops running up the beach, but i do not want to be able to see the spot where the boat landed becasues it will look stupid.. How can i do this anyone?
Thanks,
Alex
Title: Re:Intro Problems
Post by: XCess on 22 Jan 2006, 12:56:39
Try this.

Create a gamlogic, where you want the camera to look, call it g1

;============================
_cam setTarget boatName
_cam setRelpos [0,2,0]
_cam camCommit 0

_cam camSetTarget g1
_cam camCommit 0
deleteVehicle boatName

;============================

Really don't get why you want to delete the boat though.
Remember, you don't have to use the camCommited command, in fact, i never ever use it. Waits (~) are much more useful
Title: Re:Intro Problems
Post by: Alex on 22 Jan 2006, 12:59:25
Thanks dude, I have now put the group of men inside the boat with the command - "_x moveincargo logic1" foreach units group this; troop = group this;
But how can i get the men to disembark just as the boat lands and starts to fade? Then getting the men to run up the beach...
Title: Re:Intro Problems
Post by: XCess on 22 Jan 2006, 13:34:34
You could use a transport unload waypoint on the boat and a move waypoint on the group, or you could script it like this:

;=======================================
{unAssignVehicle _X} forEach units troop
{_x action ["eject",boatName} forEach units troop
~3

(leader troop) goto (getPos g1)
;=======================================

not sure on the forEach's so you might have to do the unassign and ejects for each unit, but you could use an eject script (find one in the editors depot, or make it yourself, pretty easy to do) which you would execute from the camera script. Script would look like this:


;=======================================
_boat = this select 0
_leader = _this select 1

_grp = group _leader
_gUnit = units _grp

_units = count _gUnit
_counter = 0


#loop
_p = _gUnit select _counter

unnasignVehicle  _p
_p action ["eject", _boat]

? (counter > _units) : goto "end"
~1

goto"loop"

#end
_leader goto g1
allOut = true

;=================================

that should work, but I haven't tested it so I'm not positive.
Title: Re:Intro Problems
Post by: Alex on 22 Jan 2006, 13:42:25
Again thanks loads dude, I will tell back
Title: Re:Intro Problems
Post by: Alex on 22 Jan 2006, 14:16:56
Oh, where does the {unAssignVehicle _X} forEach units troop
{_x action ["eject",boatName} forEach units troop
~3

(leader troop) goto (getPos g1)

go?
Title: Re:Intro Problems
Post by: XCess on 22 Jan 2006, 14:21:40
Put that just when the boat reaches the shore.
Title: Re:Intro Problems
Post by: Alex on 22 Jan 2006, 14:31:04
as a trigger?
Title: Re:Intro Problems
Post by: XCess on 22 Jan 2006, 14:41:19
in the script, just after delteVehicle boatName
Title: Re:Intro Problems
Post by: Alex on 22 Jan 2006, 14:42:09
and what out of

{unAssignVehicle _X} forEach units troop
{_x action ["eject",boatName} forEach units troop
~3

(leader troop) goto (getPos g1)

do i change to the names of units etc
Title: Re:Intro Problems
Post by: XCess on 22 Jan 2006, 14:48:07
If you're going to do it one by one, yes. But I have used your group name (troop) so it should work as is. But I think the eject script executed from the camera script is a better option.
Title: Re:Intro Problems
Post by: Alex on 22 Jan 2006, 14:54:07
lol sorry dude, I dont really understand, how come my group is called troop
Title: Re:Intro Problems
Post by: Alex on 22 Jan 2006, 15:10:50
sorry mate i just dont understand :P
Title: Re:Intro Problems
Post by: XCess on 22 Jan 2006, 15:12:33
Thanks dude, I have now put the group of men inside the boat with the command - "_x moveincargo logic1" foreach units group this; troop = group this;
But how can i get the men to disembark just as the boat lands and starts to fade? Then getting the men to run up the beach...

when stating troop = group this you are defining the name of your group. troop now becomes a global variable and can be used in any script or trigger.
Title: Re:Intro Problems
Post by: Alex on 22 Jan 2006, 15:33:57
OK, lets start again, I want my men to get out of the boat at fade, then run up the beach, can u help plz?
Alex
Title: Re:Intro Problems
Post by: Alex on 22 Jan 2006, 16:13:40
please dude?
Title: Re:Intro Problems
Post by: XCess on 22 Jan 2006, 16:37:32
Tell ya what.. I'll make an example, post it up here, an u can look what i did.
Won't be able to do it straight away, but when I get a chance I'll post it up.
Title: Re:Intro Problems
Post by: Alex on 22 Jan 2006, 16:44:23
Great thanks dude, You have been EXTREMELY helpful THANKS!
Title: Re:Intro Problems
Post by: XCess on 22 Jan 2006, 17:18:25
Done. I've commented the script so you can make sense of it easier, and I did the unload by way of waypoint.
I deleted the boat as you wanted and unloaded them (the loons) during a fade out (although you may want to change the wait before the fade out a second or two as it is slight too long imho)
Also did a few nice camera angles you might like ;)

And no problem, we're here to help :)

**EDIT**
the driver and gunner of the boat run towards the camera after it's deleted (as only their boat was deleted) generally i would do:

deleteVehicle boatd
deletevehicle boatg
deleteVehicle boat

as that would delete the driver and gunner too (a d on the end of a vehicle's name is it's driver, and a g is is it's gunner)
In this case however, I thought it looked pretty good, leaving a couple of men behind to hold the landing zone.
Title: Re:Intro Problems
Post by: XCess on 22 Jan 2006, 17:56:04
Also, I have a question for you. I noticed in another thread you have recently studied atleast one camera scripting tutorial (your make one cutscene after another thread). Do you think there is a need for a new camera tutorial or are the current ones good enough as is? I'm thinking of writing one myself.
Title: Re:Intro Problems
Post by: Alex on 22 Jan 2006, 18:39:30
Hmmm, I would definately think about it if I were you mate, you can explain things very well indeed.

So yes i would say make another.
Alex
Title: Re:Intro Problems
Post by: XCess on 22 Jan 2006, 18:40:45
Anything you would like to see in the tutorial in particular?
btw, did the example help?
Title: Re:Intro Problems
Post by: Alex on 22 Jan 2006, 19:15:23
Yes extremely thankyou, I'd like to see lots and lots of examples and newbie advice :P
I look forward to your tut :P
Alex
Title: Re:Intro Problems
Post by: XCess on 22 Jan 2006, 19:19:21
Glad I could help :)
Look out for the tut in the coming weeks.
Title: Re:Intro Problems
Post by: Alex on 22 Jan 2006, 19:24:00
Hmmm, something must be wrong, The boat goes in, hits the beach, then there is no fade but the men get out and start moving towards their waypoint but the boat also doesnt delete and the camera doesnt change to a different place..
Title: Re:Intro Problems
Post by: XCess on 22 Jan 2006, 19:32:21
just to debug, in the trigger add a ; to the end of wats in the onactivation
and then titleText ["test","plain"]. Im guessin the trigger didnt activate.

worked fine on my test.. ???

*edit*
just tested again an it was ok, i'll reupload incase i zipped it before it was done
Title: Re:Intro Problems
Post by: XCess on 22 Jan 2006, 19:37:16
here. wouldnt upload on edit post
Title: Re:Intro Problems
Post by: Alex on 22 Jan 2006, 20:04:24
Ok, how can i get the trigger to say "vehicle" in th activation box?
If I try to copy paste it it reverts back.
Alex
Title: Re:Intro Problems
Post by: XCess on 22 Jan 2006, 20:11:35
you mean to display the word in game? put this;

boatAtDropoff = true; titleText ["vehicle","plain down"]
Title: Re:Intro Problems
Post by: Alex on 22 Jan 2006, 20:16:39
put that in the trigger right?
Title: Re:Intro Problems
Post by: Alex on 22 Jan 2006, 20:20:15
It seems like the trigger is just not firing for some reason...
Title: Re:Intro Problems
Post by: XCess on 22 Jan 2006, 20:29:10
Well, there's two ways to solve this, either lengthen axis a on the trigger or create a move waypoint before the transport unload waypointwith boatAtDropoff = true in the onActivation field.

Very confused as to why it's not working as it's worked in every test so far. Maybe something went wrong with the zipping or upload.
Title: Re:Intro Problems
Post by: Alex on 22 Jan 2006, 20:33:33
OK, its not the axis A of the trigger, I put it to 1000 and still nothing....
BTW I have changed teams from west to east so maybe thats why? Do you ahve an MSN mate? lol
Alex
Title: Re:Intro Problems
Post by: XCess on 22 Jan 2006, 20:45:22
xcess35@hotmail.com
Title: Re:Intro Problems
Post by: XCess on 23 Jan 2006, 18:53:20
Here this should work. rename it back to intro.sqs though.