Home   Help Search Login Register  

Author Topic: My epic beach assault  (Read 2593 times)

0 Members and 1 Guest are viewing this topic.

Offline greg147

  • Contributing Member
  • **
    • Royal Air Assault Battalion
Re:My epic beach assualt
« Reply #15 on: 16 Jul 2005, 21:04:04 »
"_Boat=_This Select 0

{_Pos=GetPos _x ; _x Action ["GetOut",_Boat] ; _x SetPos _Pos} ForEach (Crew _Boat)-[Driver _Boat]"

About that script, (sorry I don't know how to quote only parts of a reply) I can't just put it in an init field or On Activation field can I. I have to refer to it with the exec command in one of those fields, could you tell me exactly how to do that because despite my talents at making good missions I've always managed to get past using those kind of scripts. I even use civilians in completely different places to run through triggers for me and that kind of stuff. So could you tell me exactly how to use that script.

To use the script, first download a script editor from the editors dept. I recomend Chris' script editor
http://www.atwar.net/download.php?view.4899

Then, make a new script with the code in it.

Save the new script into your mission file, and go into the editor

Place a trigger that you want to activate the script, and put this in its On Activation field:

[] exec "scriptname.sqs"
Royal Air Assault Battalion - [L/Cpl] Greg
RAAB

John Smith

  • Guest
Re:My epic beach assualt
« Reply #16 on: 17 Jul 2005, 12:54:46 »
Ok, greg147, thanks a lot, for the first time in my OFP life I've come slightly closer to using proper scripts however as an inexperienced guy at scripting I have several questions:

1: When I make a script what do I do with the bit where it says "Operation Flashpoint Script File"? Do I delete it or keep it there?

2: I copied the script file into my mission folder as "beachlanding" so therefore I used the following command in an On Activation field: [] exec "beachlanding.sqs" but when the trigger activates I get a message saying that beachlanding.sqs was not found. What could I have done wrong?

3: To save the script file I went to Save As and saved it as a "Script Files (*.sqs)". Is that correct?

Thanks.

Offline greg147

  • Contributing Member
  • **
    • Royal Air Assault Battalion
Re:My epic beach assualt
« Reply #17 on: 17 Jul 2005, 13:11:48 »
1: When I make a script what do I do with the bit where it says "Operation Flashpoint Script File"? Do I delete it or keep it there?

Keep it there. Or delete it, it doesn't matter. Anything with a ';' in front of it (or coloured green) does not effect the script. For example, if you wanted to write something there that didn't effect the script, you could write
Code: [Select]
; text here
2: I copied the script file into my mission folder as "beachlanding" so therefore I used the following command in an On Activation field: [] exec "beachlanding.sqs" but when the trigger activates I get a message saying that beachlanding.sqs was not found. What could I have done wrong?
Hmm.....not sure. Make sure the spelling is correct, but thats the only thing I can think of.  :-\


3: To save the script file I went to Save As and saved it as a "Script Files (*.sqs)". Is that correct

Yep  ;)
Royal Air Assault Battalion - [L/Cpl] Greg
RAAB

John Smith

  • Guest
Re:My epic beach assualt
« Reply #18 on: 17 Jul 2005, 13:52:43 »
Ok, greg147, you answered all three of my questions except the second one, and the reason for that is because I'm a complete moron. I put the script into the missions folder instead of into the folder with the name of my mission. I mistunderstood what you meant earlier. But now I've put the script file into the folder of that mission but now I have another problem. Instead of a message popping up saying the script wasn't found (because it was found) one of those weird black messages appeared at the top of the screen saying something about an unknown operator. Then I added a " at the end of the bit where it says "_Boat=_This Select 0 and at the beginning of where it says {_Pos=GetPos _x ; _x Action ["GetOut",_Boat] ; _x SetPos _Pos} ForEach (Crew _Boat)-[Driver _Boat]". I tried again and I got the same type of message with the unknown operator stuff but the |#| sign was somewhere in the Action command bit. It looked exactly like this (the Action bit that is):

_x Action ["|#|GetOut",_Boat]

Maybe this should have been a question for UNN seeing how this is his script but if anyone can find out what is wrong with it or what I have done wrong please tell me. This is exactly what the original script looks like when I open the script file (by the way, yes I did change the "Boat" into the name of the higgens craft in my mission):

"_Boat=_This Select 0

{_Pos=GetPos _x ; _x Action ["GetOut",_Boat] ; _x SetPos _Pos} ForEach (Crew _Boat)-[Driver _Boat]"

Thanks.


« Last Edit: 17 Jul 2005, 13:54:38 by John Smith »

UNN

  • Guest
Re:My epic beach assualt
« Reply #19 on: 17 Jul 2005, 16:21:01 »
Hi,

If you called a Higgens, MyBoat01...e.t.c Then in the triggers, On Activation Field you should have:

Code: [Select]
[MyBoat01] Exec "beachlanding.sqs"
It might be better to use each boats Init field instead? So in each Init field you will have:

Code: [Select]
[This] Exec "beachlanding.sqs"
In both cases beachlanding.sqs remains unchanged, from my original example.

John Smith

  • Guest
Re:My epic beach assualt
« Reply #20 on: 18 Jul 2005, 08:00:54 »
I see, I tried that before but now I just realised I didn't try it after I got rid of some extra speech marks that weren't there.

By the way beachlanding.sqs was the landing craft people running out script. So about the setdir script you, UNN, told me about. Can I assume that I can use that in the same way as the other one except in the init field or is there a way to use it without having to use the exec command in the init field which might be more reliable?

John Smith

  • Guest
Re:My epic beach assualt
« Reply #21 on: 18 Jul 2005, 08:25:59 »
I've tried the setdir script but you said that it will end after the vehicle reaches a waypoint. Does that mean that once it's gone to its first waypoint it will no longer keep going in that direction.

Did you use a get out waypoint, if not what did you do to make them run out of the landing craft. In my mission they just stand still in the landing craft. (This is about the other script by the way for the men to get out in the landing craft).

Do I use the setdir script on the driver of the boat or on the boat itself?

Also about the setdir script, you said:

"Thats the basic idea, you would have to mess around with different ways of ending the script. But it does work, there is a video example here:"

What did you mean by messing around with different ways of ending the script?

In fact, the mission you showed me the video of, how exactly did you make that part?

Thanks.
« Last Edit: 18 Jul 2005, 08:55:57 by John Smith »

UNN

  • Guest
Re:My epic beach assualt
« Reply #22 on: 19 Jul 2005, 06:06:27 »
Hi,

I'm going to finish off the Higgins, it needs some extra geometry and the anims sorting out. So I should be able to make all the functionality available, with the minimum amount of hassle from your point of view.

I'm just trying to work out what the best way of controlling this from the editor. Obviously you would want to plot the boats passage using waypoints, but what about the squad they carry? You would want them to follow there own waypoints once unloded.

I'm guessing, ATM you have the boat and cargo setup like this. With special set to In Cargo?



I thought it would be better to have something like this:



I can add a command to move the squad into the Higgins cargo positions at the start of the mission:

Code: [Select]
[Group This,Boat01] Call UNN_MoveInCargo
Then in theory the squad can have it's own waypoints, to be used once they have unloaded. The boat has it's own waypoints to depart once it's unloaded the cargo. For the waypoint you want the boat to unload on, you would just have another command in the waypoints activation field:

Code: [Select]
[Boat01] Call UNN_UnloadCombat
Would this work for what your trying to do? And anything else you think that might come in handy.

John Smith

  • Guest
Re:My epic beach assualt
« Reply #23 on: 20 Jul 2005, 08:35:41 »
Let me explain exactly what I'm trying to do.

I want a Higgens with men in it (it doesn't matter if the driver and cargo are in a different group) to land at the beach. Then I want the ramp to open and have all the men run out including the driver and I don't want the higgens to drive back. Then once the men run out, I want them to run up the beach and kick some serious anus.

Is it possible? Or do I have to take a different approach.

UNN

  • Guest
Re:My epic beach assualt
« Reply #24 on: 20 Jul 2005, 08:47:26 »
Quote
Is it possible? Or do I have to take a different approach.

It's easy enough to add, I will include an additional command to unload everyone. Should make setting up the mission easier to.

UNN

  • Guest
Re:My epic beach assault
« Reply #25 on: 22 Jul 2005, 05:07:53 »
Bah...Taking a closer look at the Higgins, the p3d is in to much of a mess for me to sort out.

Perhaps if someone who knows there way around O2 can fix it up? If they do, I will write the scripts for it.
« Last Edit: 22 Jul 2005, 08:29:52 by bedges »