Need help on retractable weapon hatches

Got questions about Shipmaker? Get answers here. Please read the stickied topics first!

Moderators: th15, Moderators

Post Reply
AnnihilatorX
Commander
Commander
Posts: 116
Joined: Sat Mar 01, 2008 3:49 am

Need help on retractable weapon hatches

Post by AnnihilatorX »

A retractable door made by a section using the following trigger configuration works but not for long:

Trigger on 1:
Weapon acquired target
Trigger on 2:
Weapon lost target

Trigger off 1:
Movement reaches target (s)
Trigger off 2:
Movement reaches origin (s)

It functions by opening up the door when target is acquired, door stops at open position due to off trigger; and vice versa for target lost. It would function well for several sequences.
However problem arises frequently which results in closing door when target acquired and vice versa when target come and go; and sometimes it stop working for some reasons.

What's the best trigger procedure for making a retractable weapon hatch that closes when target is lost, and open when target is acquired?
I can't use the adv. delay (delay after reaching target before returning to origin - P.S. I think adv. delay and ret. delay should have names swapped around) because it will make the hatch close and open even target is continuously tracked by the weapon.
Kaelis
Moderator
Posts: 1590
Joined: Fri Dec 14, 2007 4:46 am

Post by Kaelis »

Hmm, this might be problematic. I have two ideas.

Use two sections, with opposite move directions, and their targets far off in the distance. By default movement should be disabled. Trigger movement of one section (the one supposed to open the hatch) with wapon acq. target, trigger off after certain number of frames. Trigger movement of the other section (closing hatch) with weapon lost target, trigger off after a number of frames. You might need to use delays.

Other idea is to use some kind of chain of helper weapon and/or sections, that would server only for triggering, but this is a much more advanced concept.

You should also try messing with trigger delays. But to be honset, trigger actions 'weapon acquired target' and 'weapon lost target' are not meant to be used with weapons that quickly loose their targets and/or long movement sequences.
AnnihilatorX
Commander
Commander
Posts: 116
Joined: Sat Mar 01, 2008 3:49 am

Post by AnnihilatorX »

Kaelis wrote: Use two sections, with opposite move directions, and their targets far off in the distance. By default movement should be disabled. Trigger movement of one section (the one supposed to open the hatch) with wapon acq. target, trigger off after certain number of frames. Trigger movement of the other section (closing hatch) with weapon lost target, trigger off after a number of frames. You might need to use delays.
EDIT: sorry I was not thinking it through properly, I will see if I can work this through.
Kaelis wrote: You should also try messing with trigger delays. But to be honset, trigger actions 'weapon acquired target' and 'weapon lost target' are not meant to be used with weapons that quickly loose their targets and/or long movement sequences.
Any triggering events are ignored when delay is in effect. The delay aren't extended when a new event occurs. For example, I cannot have target acquired event to keep a hatch that automatically close after a certain delay open. It won't update the delay counter when it keeps acquiring the target. So I don't know how delay can help.

I used a targeting dummy weapon which is a mining laser with a modified turn rate of 20 (which is really high), and an arc comparable to my other real weapons. If there's a better weapon for that purpose please tell me.
Last edited by AnnihilatorX on Fri Feb 13, 2009 7:44 am, edited 1 time in total.
AnnihilatorX
Commander
Commander
Posts: 116
Joined: Sat Mar 01, 2008 3:49 am

Post by AnnihilatorX »

I think it may be wise to include a "move mode 2" action in SM with behavior so that a section has on and off movement sequence specified by the same fields as normal move action. Each open and close sequences both stop themselves by default when reaching target or origin. Rather than making movement stop, the trigger off fields initiate the closing sequence regardless of the state of the animation until it reaches origin or interrupted by another trigger on event and vice versa.
Kaelis
Moderator
Posts: 1590
Joined: Fri Dec 14, 2007 4:46 am

Post by Kaelis »

AnnihilatorX wrote:I used a targeting dummy weapon which is a mining laser with a modified turn rate of 20 (which is really high), and an arc comparable to my other real weapons.
What do you mean, your other real weapons? Arc should be 360, really.

If it still looses targets despite that, then it looks like its a bug.
AnnihilatorX
Commander
Commander
Posts: 116
Joined: Sat Mar 01, 2008 3:49 am

Post by AnnihilatorX »

Kaelis wrote:
AnnihilatorX wrote:I used a targeting dummy weapon which is a mining laser with a modified turn rate of 20 (which is really high), and an arc comparable to my other real weapons.
What do you mean, your other real weapons? Arc should be 360, really.

If it still looses targets despite that, then it looks like its a bug.
The hatch is positioned facing broadside so I do not want 360 arc really. The current arc settings is 75 which is a bit higher than the other real weapons inside the hatch.

It doesn't actually lose target when a target is in sight. The hatch doesn't close prematurely. Sometimes it just doesn't close. And another new target would then make it close. This unreliability is why I am stuck :/

I am sure it's not trigger linking problem as I have 4 of these hatches each manually made and connections checked.
Last edited by AnnihilatorX on Fri Feb 13, 2009 8:01 am, edited 1 time in total.
Kaelis
Moderator
Posts: 1590
Joined: Fri Dec 14, 2007 4:46 am

Post by Kaelis »

...no wonder it loses targets, then. Duh. Why would you want it to react only to targets inside that 75 degrees arc anyway?
AnnihilatorX
Commander
Commander
Posts: 116
Joined: Sat Mar 01, 2008 3:49 am

Post by AnnihilatorX »

Because the range is quite high. It'd react to targets at the other side of the ship and the weapons inside the hatch can't fire anyway. It'd look strange say an enemy ship is on the left and the hatches on the right just opens and not fire if you know what I mean :)
Kaelis
Moderator
Posts: 1590
Joined: Fri Dec 14, 2007 4:46 am

Post by Kaelis »

Ohhh... i misinterpreted and thought you wanted the hatch to be open when there is an enemy nearby.

In that case, you should try experimenting with weapon fire trigger action.
AnnihilatorX
Commander
Commander
Posts: 116
Joined: Sat Mar 01, 2008 3:49 am

Post by AnnihilatorX »

Got it working thanks.

Basically I utilised 2 oscillating sections to keep a constant barrage of trigger firing. This serves as a memory element required for the triggering sequence. The instant one-off firing of acquired and lost target requires a memory element to keep themselves from interfering with each other too quickly.

What I've done is as follows:

Chronological order:

Pilot dummy targeting weapon
->acquired target
->triggers a oscillating section 1 (quick back and forth rotation)
->rotation reaches CW triggers hatch opening (repeating)
->movement of hatch reaches target ("target" = fully opened position)
->trigger off oscillating section 1 (stops the constant firing of CW trigger)

Pilot dummy targeting weapon
->lost target
->triggers a oscillating section 2 (quick back and forth rotation)
->disables pilot dummy targeting weapon (set to offline)*
->rotation reaches CW triggers hatch closing (repeating)
->movement of hatch reaches origin
-> trigger off oscillating section 2

*is to disallow acquired target to fire and disrupt the closing of hatch

Triggering properties of weapons:

Pilot dummy targeting weapon
- initially online
-trigger ons:
- self frame elapsed = hatch opening time
- hatches movement to origin
-trigger offs:
- oscillating section 2 reaches CW border

Other real weapons:
-initially offline
-trigger ons:
- Movement of hatch reaches target
-trigger offs:
- oscillating section 2 reaches CW border #

# used as trigger off for real weapons other than hatch reaches origin is to prevent firing while hatch is closing

Optionally an "on delay" can be put on both oscillating section to smooth out the opening and closing when enemy keep appearing and disappearing in and out of line of sight, e.g. fighters.
Silver Swordsman
Commander
Commander
Posts: 247
Joined: Sat Jan 31, 2009 1:38 pm
Location: A clustered inhabitance

Post by Silver Swordsman »

Hey, I have a similar problem, although I can't make head or tail about the trigger thing.

Should the trigger be set on the weapon piece or the section? Both exhibit the same trigger panel, and I'm not sure which one is which and vice versa.

Basically, I have a ship that sports a railgun. When the weapon acquires a target, the doors should slide open, and when the target is lost, the doors should close. It partially works (as in it opens when the weapon acquires target, but it keeps on oscilating every 30 frames, and when the target is destroyed/lost, the doors remain stuck open)

I can't find any threads regarding triggers and drivers, so I'm pretty much groping in the dark, using only the Pendulum ship as a guide.
If admirals hate and trash your ships,
If you can't get it right;
Then off you go, but don't call quits;
Just go make custom sprites.

Solare:
http://www.wyrdysm.com/phpBB3/viewtopic.php?f=2&t=4858
Kaelis
Moderator
Posts: 1590
Joined: Fri Dec 14, 2007 4:46 am

Post by Kaelis »

Nice job, AnnihilatorX.
Silver Swordsman wrote:I can't find any threads regarding triggers and drivers, so I'm pretty much groping in the dark, using only the Pendulum ship as a guide.
Are you freaking blind?
http://www.wyrdysm.com/phpBB2/viewtopic.php?t=3556
Its up there, on the top, first thread, and an announcement too :|
Post Reply