Hard Light Productions Forums

Modding, Mission Design, and Coding => The FRED Workshop => Topic started by: 0rph3u5 on November 24, 2006, 02:03:26 pm

Title: Confirming kamikaze hits??
Post by: 0rph3u5 on November 24, 2006, 02:03:26 pm
I need to arrange some FREDing in which the number of kamikaze fighters hiting a cruiser plays an important role... but I've yet not figured out how to determine this without major problems which could turn the whole thing to become crappy and buggy

I figured out 2 ways yet but both have their pros and cons... but you will see

It's following situation (it's a test run so don't expect much story, logic or something similar):

1)
via distance - hit count stored in varible
Code: [Select]
$Formula: ( every-time
   ( <
      ( distance "EAS Hera" "<any hostile>" )
      100
   )
   ( modify-variable
      @HitsonHera[0]
      ( + 0 @HitsonHera[0] )
   )
)
+Name: hera hit +1
+Repeat Count: 1
+Interval: 1
+Team: 0

$Formula: ( when
   ( > @HitsonHera[0] 15 )
   ( send-message
      "EAS Hera"
      "High"
      "hera done for"
   )
)
+Name: hera pounched enough v
+Repeat Count: 1
+Interval: 1
+Team: 0
contra: very in-accurate since no all possible points which maybe hit are in this range or ships which enter the range and get shot down are still counted

2)
via hull status - 1 kamikaze does 1% damage on the hera[/i]
Code: [Select]
$Formula: ( when
   ( < ( hits-left "EAS Hera" ) 85 )
   ( send-message
      "EAS Hera"
      "High"
      "hera done for"
   )
)
+Name: hera pounched enough h
+Repeat Count: 1
+Interval: 1
+Team: 0
contra: firendly fire from fighters and by the zeus influnces the count...

I hope you can improve any of those or help me to find a thrid, fourth or fifth solution which might be better...
Title: Re: Confirming kamikaze hits??
Post by: karajorma on November 24, 2006, 03:03:28 pm
When do you need this by? Cause I'm planning on some changes after 3.6.9 that might make this a whole lot easier.
Title: Re: Confirming kamikaze hits??
Post by: 0rph3u5 on November 24, 2006, 03:08:25 pm
I want to have this done ASAP 'cause it has been pestering me since a long time...
but the campaign I'm using this in can't be released prior TBP 3.4 which has yet no concrete release date (except form "soon")
ergo we got nearly all time of the world
Title: Re: Confirming kamikaze hits??
Post by: Mobius on November 25, 2006, 12:54:33 pm
When do you need this by? Cause I'm planning on some changes after 3.6.9 that might make this a whole lot easier.

WOO-HOOO!!!! THAT'S WHAT MAKE US PROUD!!!!


Accept my suggestion...it could be bogus(I haven't tried it)...

I don't know if a ship ordered to do a kamikaze run on a specific target will go straight for a specific subsystem if it was ordered to attack it previously....

Using when-argument, do something like this...

a kamikaze ship destroyed close from a subsystem(use <argument> for all the subsystems)will increase the kamikaze count of 1 unit. The Hyperion has many turrets and subsystems so the area valid for kamikaze attacks goes all around the hull. You may select just the engines and make the kamikaze go straight for them...boh...

What Hyperion are you using? The Hyperion I have DLed time ago had a problem with docking,I have fixed it with PCS.Your model could have the same problem.
Title: Re: Confirming kamikaze hits??
Post by: karajorma on November 25, 2006, 01:55:38 pm
He's talking about the Babylon 5 Hyperion most likely :)

I do like the idea of using when-argument. I was having similar thoughts earlier this morning but I wanted to play about with them in FRED before I posted in case I could come up with something better :)
Title: Re: Confirming kamikaze hits??
Post by: Mobius on November 25, 2006, 02:04:28 pm
Ah,I'm you best trainee. :)
Title: Re: Confirming kamikaze hits??
Post by: 0rph3u5 on November 25, 2006, 03:08:06 pm
I'll toy around a bit with your suggestion... maybe we'll see aceptable results later...
But as I see it I'll have to do all events for all kamikazes at any time... I'm not quite sure if it works but if you don't try you don't fine out... :)
Title: Re: Confirming kamikaze hits??
Post by: AdmiralRalwood on November 25, 2006, 09:31:40 pm
I have to wonder why you absolutely need to do the mission that way. Is there a specific reason you can't just have the enemy disable the engine normally? Or are you just going for the novelty of counting kamikaze hits?
Title: Re: Confirming kamikaze hits??
Post by: Mobius on November 26, 2006, 07:04:13 am
Well he want to do this way.


Anyway you could come up with a better idea:since there aren't other hostile forces,simply use < hits-left than. See which amount of damage a kamikaze inflicts and moltiplicalo per 15 times. If a kamikaze inflicts 2% of damage,then hits-felt less than 71.

If other strike forces(not kamikaze units)attack the Hyperions before the kamikaze,you have to assign the hits left after this strike to a variable and then consider it for the kamikaze.
Title: Re: Confirming kamikaze hits??
Post by: Titan on November 26, 2006, 03:06:28 pm
then hits-felt less than 71.

Felt?  ;)
Title: Re: Confirming kamikaze hits??
Post by: Mobius on November 30, 2006, 05:58:24 pm
left....
Title: Re: Confirming kamikaze hits??
Post by: 0rph3u5 on December 03, 2006, 03:44:09 pm
I have to wonder why you absolutely need to do the mission that way. Is there a specific reason you can't just have the enemy disable the engine normally? Or are you just going for the novelty of counting kamikaze hits?

I won't tell... I will not spoil my campaign's story here (I've been working a year on it and kept it all secret; makes no sense stating talking about it now)
Title: Re: Confirming kamikaze hits??
Post by: Mobius on December 04, 2006, 06:12:28 pm
Our suggestions were ok or not?
Title: Re: Confirming kamikaze hits??
Post by: 0rph3u5 on December 05, 2006, 10:00:25 am
Our suggestions were ok or not?

I don't know if a ship ordered to do a kamikaze run on a specific target will go straight for a specific subsystem if it was ordered to attack it previously....

Using when-argument, do something like this...

a kamikaze ship destroyed close from a subsystem(use <argument> for all the subsystems)will increase the kamikaze count of 1 unit. The Hyperion has many turrets and subsystems so the area valid for kamikaze attacks goes all around the hull. You may select just the engines and make the kamikaze go straight for them...boh

this one was good... in-vitro it appeared to be fine (but you should not turst in-virto-FREDing) - will run a less determined version later...
but I'm waiting for kara to present his new code-"thing" before I draw a concluding judgement

Anyway you could come up with a better idea:since there aren't other hostile forces,simply use < hits-left than. See which amount of damage a kamikaze inflicts and moltiplicalo per 15 times. If a kamikaze inflicts 2% of damage,then hits-felt less than 71.

I posted something similar initially... You will see aboth that this variant had an error I couldn't ignore
Title: Re: Confirming kamikaze hits??
Post by: karajorma on December 05, 2006, 10:02:50 am
It will be a while. I have a fair bit on my plate at the moment. And it does rather depend on whether the game currently counts kamikaze damage when working who who damaged whom for the events log (Something I've yet to bother looking up in the code).
Title: Re: Confirming kamikaze hits??
Post by: Mobius on December 05, 2006, 01:31:14 pm
Keep us updated...

Karajorma:YOu talked about team loadout,right?
In a mission you have to escort,I don't know,some frighters carrying weaponry.For each freighter down,the number of warheads available in the next mission is reduced in proportion.
Actually you can create three different missions and every mission has a specific X number of warheads of a particular type available.

What are you going to do is connected to stuff like this?
Title: Re: Confirming kamikaze hits??
Post by: karajorma on December 05, 2006, 02:45:12 pm
What are you going to do is connected to stuff like this?

Finish the team loadout code. That's EXACTLY the sort of thing it was supposed to allow :D

It already does it for ships. I simply have to finish it so that it does it for weapons too. If you're really interested I wrote a page in the wiki (http://www.hard-light.net/wiki/index.php/Improved_Team_Loadout) on how the ship stuff works.
Title: Re: Confirming kamikaze hits??
Post by: Mobius on December 05, 2006, 03:04:35 pm
Well,we are lucky.


Missions like the one I have described are vital in a campaign ans should be common too.
It's the exact meaning of the word "supply"
Title: Re: Confirming kamikaze hits??
Post by: karajorma on December 05, 2006, 04:38:44 pm
Oh I agree. The reason I wrote the whole system was that I wanted to make a campaign where you were based on a capship in enemy terratory and as your wingmen got killed you found less and less ships and weapons available in the loadout options.

As I said the system is basically working for ships. Although the SEXP for checking how many ships are left at the end of a mission is very crude at the moment and will be replaced by several SEXPs giving you much more granular control.

Now that I think about it the changes 0rph3u5 is waiting on and the ones I need to make for finishing off the loadout code actually go through the same code. That probably means that the damage stuff might come faster than I initially thought.
Title: Re: Confirming kamikaze hits??
Post by: Mobius on December 06, 2006, 02:23:07 pm
Using variables should make everything easier,both creating and managing the new SEXPs.

ETA...?
Title: Re: Confirming kamikaze hits??
Post by: karajorma on December 06, 2006, 02:42:25 pm
The system works using standard persistent variables so there's absolutely nothing stopping you from simply ignoring the SEXP I made and simply adjusting the variables yourself.

As for an ETA. Some time after BtRL's demo is out I'll start working on it again.
Title: Re: Confirming kamikaze hits??
Post by: Mobius on December 07, 2006, 12:41:10 pm
I'm sure I will like it. It's powerful and interesting.