Home   Help Search Login Register  

Author Topic: FDF Radio and mortar questions  (Read 1355 times)

0 Members and 1 Guest are viewing this topic.

Offline greg147

  • Contributing Member
  • **
    • Royal Air Assault Battalion
FDF Radio and mortar questions
« on: 01 Aug 2005, 20:44:16 »
Hi all,
I posted thsi on the FDF forums, but didn't get any answer, or any views of the topic for that matter  :P

Anyway, so i thought i'd post here, see if anyone knows.

I've got 2 questions about using FDF in mission making

1. Is there a way to detect weither the Sanla radio has been opened on screen, and can you also detect when the co-ords have been sent through? If so, how?

2. How do you make the Finnish 80mm mortar fire off a round?

Number 2 isn't as important as number 1, as I don't need it if number 1 is impossible.

Thanks  ;)
« Last Edit: 01 Aug 2005, 20:45:01 by greg147 »
Royal Air Assault Battalion - [L/Cpl] Greg
RAAB

Offline Baddo

  • Former Staff
  • ****
  • Reservist Jaeger
Re:FDF Radio and mortar questions
« Reply #1 on: 06 Aug 2005, 13:16:56 »
Detect when SANLA has been opened/closed

To detect when SANLA has been opened on the screen, use this little piece of code:

Code: [Select]
ctrlVisible 123882
This returns true or false depending on if a certain control of the SANLA dialog (defined in finmod\bin\resource.cpp) is visible or not. This particular control with the idc 123882 is SANLA's text screen where messages are shown.

Maybe the easiest way to use this to your advantage is to create a trigger:

axis a = 0, axis b = 0
activation: repeatedly
type: switch
condition: ctrlVisible 123882
on activation: player groupChat "SANLA opened"
on deactivation: player groupChat "SANLA closed"


Of course you can also do the check in a script.

From here on it should be easy to modify this to your needs.

Detect when SANLA coordinates have been sent

By checking when the FDFtykistoState variable gets a value of 1 we will know that the user sent coordinates through SANLA, and the artillery team in the other end is available and they accepted the input the player typed to SANLA.

:P

So, another trigger:

axis a = 0, axis b = 0
activation: repeatedly
type: switch
condition: FDFtykistoState == 1
on activation: player groupChat "Firing..."
on deactivation: player groupChat "Firing over"


We can also easily check when the player has pressed the "LÄHETÄ" button (send) on the SANLA using the ctrlText command. Create a trigger:

axis a = 0, axis b = 0
activation: repeatedly
type: switch
condition: ctrlText 123882 == "_"
on activation: player groupChat "Message sent"


But this doesn't check for errors in the input nor if the artillery is available and does it have ammo so monitoring the FDFtykistoState variable is a better way.

I guess you are thinking of an AI mortar soldier actually fire his mortar when the player uses the SANLA to tell him where to shoot and how many rounds. That's a bit more complicated than just monitoring the regular usage of SANLA what we just did.

You would probably need to delete the mortar round (which was just fired) after it has been flying some time and then createVehicle new mortar rounds to the location where the player wanted them to drop (possibly combining a setVelocity command to make the mortar round come in approximately accurate direction and angle compared to what it would have been in a real situation). This because I think it's near impossible to make an AI to shoot with the mortar and actually hit the desired target location. Please correct me if I'm wrong (which I am hoping to be).

I hope this helps you to get forward.

:)

« Last Edit: 06 Aug 2005, 19:37:27 by Baddo »

Offline greg147

  • Contributing Member
  • **
    • Royal Air Assault Battalion
Re:FDF Radio and mortar questions
« Reply #2 on: 06 Aug 2005, 20:57:49 »
Thanks for the Sanla info. That really helps, just what I needed  ;D

As for the Mortar round, its a lot simpler than that. I just want the mortar to fire during a small cutscene,  so when the co-ords are sent by the player, a cutscene shows a mortar fire a shot, then the cutscene ends, and the normal sanla artillery continues, so it looks like the mortar has fired the round, but it hasn't.  ;)
Royal Air Assault Battalion - [L/Cpl] Greg
RAAB