Home   Help Search Login Register  

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

0 Members and 1 Guest are viewing this topic.

John Smith

  • Guest
My epic beach assault
« on: 12 Jul 2005, 15:17:09 »
I've been working on this beach assualt for ages and when everything goes right it looks amazing. The only problem is that when the landing craft approach the beach it sometimes occurs that 1 to 3 of the landing crafts attempts to avoid and beach usually turning right at an angle of 100 degrees. I've seen this a lot in the past and I'm sure many people know what I'm talking about so if you know how to ensure that the landing craft will go on a straight path without changing direction until they are told to get out along with their men please tell me. I would really appreciate it.
« Last Edit: 22 Jul 2005, 08:28:39 by bedges »

Offline Pilot

  • Contributing Member
  • **
Re:My epic beach assualt
« Reply #1 on: 12 Jul 2005, 15:22:08 »
Yes, this 'feature' of OFP can be a pain.  You could try one of several things:
1: Change the behaviour of the ships to "CARELESS"
2: Change the speed of the boats to "LIMITED" when they get near the shore
3: Give the boats a continuous setvelocity command to keep them going in a straight line

I'm not sure if #1 and #2 would work, I'm just grasping at straws.  I am sure that #3 would work

-Student Pilot

John Smith

  • Guest
Re:My epic beach assualt
« Reply #2 on: 12 Jul 2005, 15:27:36 »
About the first idea. If I put them on careless won't it mean that once they get out of the boats they have to take their guns off their backs.

About the second one, I'll try it as soon as I get the chance.

About the third one, I tried giving the vehicles a little setvelocity jolt right before the beach but because the driver still has power over the direction of the boat the setvelocity idea isn't very effective. I could of course make the jolt stronger but then most of the boats would probably land half way up the beach. However I haven't tried continuous setvelocity yet. Thanks for the idea.

Any more ideas would be appreciated.

John Smith

  • Guest
Re:My epic beach assualt
« Reply #3 on: 12 Jul 2005, 16:31:44 »
Is there a way maybe to use a sort of command like switchmove. For example with units you can tell them to run forward using a command instead of a waypoint, isn't that possible with vehicles.

Offline Pilot

  • Contributing Member
  • **
Re:My epic beach assualt
« Reply #4 on: 12 Jul 2005, 16:41:16 »
I don't know of any way like that besides setvelocity.  You could try either deleting the crew of the boats, or disableAI "MOVE" them and then use setvelocity.  However, if you did that, they wouldn't be available for use later in the mission.

-Student Pilot

John Smith

  • Guest
Re:My epic beach assualt
« Reply #5 on: 12 Jul 2005, 16:59:56 »
Is there a way maybe to make the driver dead but not look like he's dead and then bring him back to life later on and that the enemy still thinks he's alive and shoots at him.

UNN

  • Guest
Re:My epic beach assualt
« Reply #6 on: 12 Jul 2005, 17:25:29 »
I did something similar:



You can use SetDir to keep the boats running parallel to each other. With a bit of trial and error on the Move Waypoint you can get them to hit the beach in good order.

Code: [Select]
_Boat=_This Select 0

_Dir=GetDir _Boat

#Loop

_Boat SetDir _Dir

~0.001

If !(UnitReady _Boat) Then {goto "Loop"}

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:

WW2 Beach Landing (4mb)
« Last Edit: 12 Jul 2005, 17:26:29 by UNN »

Offline 456820

  • Contributing Member
  • **
Re:My epic beach assualt
« Reply #7 on: 12 Jul 2005, 19:00:00 »
use careless on the boat only but the groups first waypoint can be set as combat
i had this problem in one of my beach missions all fixed now because of that careless waypont and put the waypoint of transport unload alot further p the beach so they turn of later into the beach workd for me

John Smith

  • Guest
Re:My epic beach assualt
« Reply #8 on: 13 Jul 2005, 08:43:48 »
About only giving the driver a careless behaviour, well, the problem is is that there are some features in my beach assualt which require the driver and it's group to be in the same squad.

I have two questions for UNN:

1: When it comes to script I only use simple ones, so my question is can that script be put in an initialisation or On Activation field just like that or do I have to use a command like: "this exec" and then refer to the script.

2: I saw from your screenshots that you used a different landing craft and I was just wondering where you got it, because it seems to be much more appropriate than the one I downloaded from ofp.gamezone.cz. Maybe you could give me a link. Thanks.




UNN

  • Guest
Re:My epic beach assualt
« Reply #9 on: 13 Jul 2005, 10:44:43 »
Quote
1: When it comes to script I only use simple ones, so my question is can that script be put in an initialisation or On Activation field just like that or do I have to use a command like: "this exec" and then refer to the script.

Depends how your boats are approaching the beach, for my example I had the boats pointing towards the beach from the start of the mission. So I ran a script from the init line of each boat, that stopped when it reached a waypoint.

Quote
2: I saw from your screenshots that you used a different landing craft and I was just wondering where you got it, because it seems to be much more appropriate than the one I downloaded from ofp.gamezone.cz. Maybe you could give me a link. Thanks.

I don't have the original link, but that version was modified by myself to animate the door and allow the AI to run onshore. But your welcome to that:

MP Higgens

John Smith

  • Guest
Re:My epic beach assualt
« Reply #10 on: 15 Jul 2005, 12:26:00 »
You said it depends how my boats are approaching the beach. In my case the boats are already facing the beach and their first waypoint is to move to a position in front of the waypoint and then the next waypoint is for them to get out. (The reason for the first waypoint is what I used to minimise the probability that this problem would occur and it did work slightly however the problem still remains). So how would you use that setdir command if you were me.

Also, that link you gave me for the Higgens which has an openable door, well, it doesn't work. When I use it the door is already open and I can't close it and when troops get out they just do so like with every other boat. Is this normal or do I have to use a script or something.
« Last Edit: 15 Jul 2005, 12:35:07 by John Smith »

UNN

  • Guest
Re:My epic beach assualt
« Reply #11 on: 16 Jul 2005, 00:05:53 »
Hi,

Use the animate command to open and close it:

To open the ramp :
Code: [Select]
Boat01 Animate ["CloseRamp",0]To close the ramp :
Code: [Select]
Boat01 Animate ["CloseRamp",1]
Quote
Is this normal or do I have to use a script or something.

Yeah, you will have to use something like this, instead of the GetOut waypoint:


Code: [Select]
_Boat=_This Select 0

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

I lost the old test mission I used for the video :( otherwise you could have had that to.

Offline penguinman

  • Contributing Member
  • **
  • Money is worthless, just paper, ink, and threads
Re:My epic beach assualt
« Reply #12 on: 16 Jul 2005, 00:18:40 »
thats an awsome higgens UNN, could you please do the same thing with the MI26 addon, http://ofp.gamezone.cz/index.php?showthis=8085

its the same as the higgens except the door opens in the back, the door already opens via the action menue, so how would i get the troops to charge out the back of the helocopter? thanks


also, i think i know the problem,

give the higgens a move waypoint that is still in the water right before where you want them to land like 5 meters out from the land, then give it a unload waypoint on the beach itself. or you may just use UNNs script.

UNN

  • Guest
Re:My epic beach assualt
« Reply #13 on: 16 Jul 2005, 03:25:42 »
Hi,

The original Higgens was by Mars911:

http://ofp.gamezone.cz/index.php?sekce=unofaddons/boats&archiv=true&page=2

The Higgens cargo positions are already standing, so it's easier to get the transition. It's the same principle I used for the Caribou para scripts. But again, when your cargo is seated. You really need custom animations to get them in the correct positions to walk\run off. But you could get away without anims for the MI26, as long as you did not look to closely when they start standing up. I barley started messing around with OFPAnim, have to check how easy it is to move them off centre.

I should really do a proper version of the Higgens, they just rush out on mass in the video. But it could all be self contained, with functions for Safe and Combat unload.

Cheers
« Last Edit: 16 Jul 2005, 03:27:40 by UNN »

John Smith

  • Guest
Re:My epic beach assualt
« Reply #14 on: 16 Jul 2005, 08:51:29 »
"_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.

Also another question, about the setdir thing, how do I use it and will it solve all my problems because you see I have 11 landing craft each with twelve men approaching the beach and all the men have all been giving "this setunitpos "up"" in their init fields. That's a 132 men running up the beach. However the landing craft approach the beach in four distinct rows instead of just going at a bearing of 0 degrees. Will the setdir thing solve that as well?
Also UNN said that if the boats are already facing the beach directly then the setdir thing could be inserted in the init field. I tried that and the game blocked it and said something about global variables but then again I copied that setdir thing entirely. I assume you have to type it in a different way or use slightly different commands. How?

In other words, I need an exact description of how to get those men out of the landing craft like in that video, and I need an exact description of how to use that setdir command in the init field like you did in the video.

Cheers
« Last Edit: 16 Jul 2005, 15:04:43 by John Smith »

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 »