Author Topic: Auto repair system  (Read 1673 times)

0 Members and 1 Guest are viewing this topic.

Offline Asprin

  • 27
It's easy and funny.

1). Open model in the MODVIEW or in any POF editors
2). Select main group (for example GROUP 1), call it "Skin". then type in properties window:

$special=subsystem
$name=Skin

3). Find the model in SHIPS.TBL and add "SKIN" subsystem. Set  power of subsystem 70 or higher of ship hitpoints.

4). In the FRED event editor create new event, example:


    Self Repair
  *op every-time
       *op <
            *op hits-left
                         Alpha 1
                  100
       *op set-subsystem-strenght
                    Alpha 1
                    Hull
            *op  -
                    *op hits-left-subsystem
                                  Alpha 1
                                  Skin
                           6

In mission file will looks like:

$Formula: ( every-time
   ( < ( hits-left "Alpha 1" ) 100 )
   ( set-subsystem-strength
      "Alpha 1"
      "Hull"
      ( -
         ( hits-left-subsystem
            "Alpha 1"
            "Skin"
         )
         6
      )
   )
)
+Name: Self Repair
+Repeat Count: 1
+Interval: 1
+Team: 0


We've used this code in the WDF campaign at MVG Grey Star. However, there is a problem. :confused: Despite of opportunity of restoration, it is possible to eliminate such ship and most advantageously. From time to time happeness next: The destroyed ship has not blowing up, that mean remains in a condition chaotic rotations. Can any find resulution of this problem? Because we've use rather strange debug:

    Debug Self Repair
  *op when
       *op <
            *op hits-left
                         Alpha 1
                   5
       *op self-destruct
                    Alpha 1
QuantreTech Studios

 

Offline starfox

  • 28
Could also be used for Whitestars and other ships with Bio-Organic Hull/armor...
Rig:
A8N-SLI Premium
AMD 64 X2 4200+
GF 7950 GT
X-FI ExtremeMusic
HEC 550W
2 Gt RAM
Win XP

 

Offline Trivial Psychic

  • 212
  • Snoop Junkie
Sounds like a job for WMC's armor table.
The Trivial Psychic Strikes Again!

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
I'm a little lost as to what you're doing here. There are ways of making an auto-repair system without the need to alter the models. Are you doing that so that there is an actual subsystem you can damage to turn off auto repair?
Karajorma's Freespace FAQ. It's almost like asking me yourself.

[ Diaspora ] - [ Seeds Of Rebellion ] - [ Mind Games ]

 

Offline Asprin

  • 27
Quote
There are ways of making an auto-repair system without the need to alter the models.


For example?

Quote
Are you doing that so that there is an actual subsystem you can damage to turn off auto repair?


We're hope on the updated version of the [every-time] operator. The current version works as [permanently performance], and we need that it will be as [permanently, but only one time].

Example:

Curren version:
[Every-time the distance between two objects is 2000 > send messege.]

So, current version of operator will be send messege permanently without stop.


What we need:
[Every-time the distance between two objects less then 2000 -> send messege.]

Messege will be send only one time, but will be send again when this condition will be repeated.
QuantreTech Studios

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Quote
Originally posted by Asprin For example?


Tell me exactly how you want the auto repair system to work in detail and I'll probably be able to detail it for you to your specifications.

Cause when it comes to auto repair I can think of a huge number of variations that could probably be done using the current system.

So what do you want? A simple system that simply repairs the ship every few seconds, a system that scales the damage depending on how much has been inflicted to the ship so far, a system like Freelancer's where you have a finite number of repairs which you can trigger whenever you want.

I've not tried making any of those but I see no real reason why they couldn't be made pretty easily. If you want other ships to be able to destroy or damage the auto-repair system then obviously you'll need a subsystem. If not you can probably do everything straight from the events editor.
 
Quote
Originally posted by Asprin We're hope on the updated version of the [every-time] operator. The current version works as [permanently performance], and we need that it will be as [permanently, but only one time].

Example:

Curren version:
[Every-time the distance between two objects is 2000 > send messege.]

So, current version of operator will be send messege permanently without stop.


What we need:
[Every-time the distance between two objects less then 2000 -> send messege.]

Messege will be send only one time, but will be send again when this condition will be repeated.


I see what you want but you don't need a new operator for that. You simply need to be a little creative with what you already have.

Here's what I would do.

Event 1
Every-Time
-and
--<
---distance
----object 1
----object 2
---2000
-- =
---SendMessage(0)
---0
-Send-Message
--Message name etc goes here
-modify-variable
--SendMessage(0)
--1

Event 2
Every-Time
->
-distance
--object 1
--object 2
--2000
-modify-variable
--SendMessage(0)
--0

I've not tested it but that should do what you're requesting. The first time you go closer than 2000m a message will be sent but the variable SendMessage is set to a value of 1 preventing further messages being sent.

When you go outside the 2000m distance the variable is reset to it's original value allowing event 1 to trigger as soon as you get within 2000m again.
« Last Edit: July 13, 2005, 11:33:39 am by 340 »
Karajorma's Freespace FAQ. It's almost like asking me yourself.

[ Diaspora ] - [ Seeds Of Rebellion ] - [ Mind Games ]