Nexus Modding > Mod Development / Released Mods
Freespace
Arparso:
You'd still have the problem of "delaying" the actual shot. The start and travel EFX get played back immediately when the weapon is activated, while the end EFX and the ship's impact EFX will get played back when the projectile hits. So every laser and even every super-fast projectile trying to look like a laser would hit the ship the moment it is activated without waiting for the Start EFX to finish - and thus they immediately trigger the end and impact EFX and apply their damage to the target. Usually that's not a problem, unless you want a "charge EFX".
Would be actually great to have that sort of capability... not only Start, Travel and End, but also a ChargeEfx setting.
Anyway, I've applied a little laser magic to the Aeolus cruiser - you absolutely DON'T want to cross those beams:
... and I hate turret placement in Lightwave ... took me ages to prevent those things firing through the hull using CannonMaxFireAng ...
Mularac:
I've come up with a solution, of sorts. Basically, this is my idea:
Have the "start" effect as a weapon, so that when it fires, we add, via the installdevice command, the beam weapon itself. This weapon should take as less time to charge as possible, I'd recommend something close to 0.5 or 1 second. Well, with a good sync, the fire of that weapon would be in the exact moment as it was in freespace. Once it fired, we disable the weapon and wait till the effect is off and then we delete it, waiting for the cicle to start all over again. The cool thing is that once we add the weapon with the installdevice command it won't show on the manual panel, but I don't know about the panel of enemy ships firing at you, haven't tried that yet.
There's only one problem with this method, but I think that it can be easily corrected with a bit of good harpointing: as the "charge" and "attack" effects are two different weapons, they will initiate in two different harpoints. Well, to counter that, when adding a hardpoint layout to your ship you should put two hardpoints in one location, where the beam cannon will be located, and then work arround with the sets to make sure that everything goes as planned (dunno what would happen with ships that have multiple beam emplacements... that could get a little messy...)
Anyhow, it's a start. So, here's the machine that would handle the weapons. Have in mind that I coded assuming that the beam weapon (the one responsible with the travel and end effect) took about 1 second to charge, and that the "start" one took more than 6 seconds, but that can be changed in the code) :
--- Code: ---Machine "Beam"
State Fire
Rule event in
:action
SelectEx(s.this:Devtype=#beam_start,
RequestFiredEvent(s.this,1);
);
:end
END
Rule event Fired
condition IsValid(E.location)&E.location:devtype=#beam_start
:action
Debug("Fired1. The ship is:", e.location:owner, "and the target:", e.location:target);
ownr:=e.location:owner;
targ:=e.location:target;
Timer(Open_Fire, 1.9, e.target:=targ;e.ownr:=ownr);
:end
END
Rule event Open_Fire
condition IsValid(e.target)&IsValid(e.ownr)
:action
Debug("the ship is:", e.ownr, "and the target:", e.target);
InstallDevice(e.ownr, #magma_beam_travel);
SelectDevices(1, e.ownr, s.this:devtype=#beam_travel);
ExecList(1,
RequestFiredEvent(s.this,1);
TargetWeapon(s.this, e.target);
);
:end
END
Rule event Fired
Condition IsValid(E.location)&E.location:devtype=#beam_travel
:action
EnableDevice(e.location,0);
weap:=e.location;
Debug("Fired2. The ship is:", e.location:owner, "and the target:", e.location:target);
Timer(DeleteDevice, 3, e.wep:=weap);
:end
END
Rule event DeleteDevice
:action
DeleteDevice(e.wep);
:end
END
END
END
--- End code ---
FYI: I've named in this code the start effect as "beam_start" and the main one as "beam_travel"
Arparso:
Cool idea, works like a charm. I can imagine quite a few problems with that, however.
1. You'd essentially block one of the already few weapon slots Nexus gives us, since one slot has to be available for the hidden beam weapon all the time... even more, if you've got multiple beams on the ship.
2. There's the chance of the hidden beam not firing at all, because the target could have gotten out of reach during the starting weapon's charge. The beam charge takes up to 2.9 seconds right now, which is more than enough time to maneuver out of range / out of the firing arc... would look odd having the charge EFX and sound, but no actual beam.
3. You'd have to create the ship mesh with that in mind, which would greatly restrict possible weapon loadouts. You could only install charging beam weapons, where the actual model allows that (and you can't really "enable" more than two or three slots to use that kind of weapon because of 1.)
4. Just my personal taste, but I see mission-level scripts as kind of a last resort for such elementary mechanics like functioning weapons. Sure, in some cases you can't avoid it, because you really need/want a certain effect, that can't be done otherwise. Still, I'd like the mission scripts to be relatively clean and focus on actual mission behaviour... that would make it easier for other mission scripters as well, since they don't need to include any of my scripts in their missions to not break the game.
The real deal breaker for me is the first argument, I fear. I can't see how to get around that right now. :(
Thanks for the effort though. It's appreciated :)
Arparso:
Another short video, this time the GTC Aeolus with beam cannons, turrets and flak guns and a glorious Nexus-style explosion:
http://www.youtube.com/watch?v=66wdFAUQTgM&fmt=22
Mularac:
yeah... 1) would be the real problem... 2) could be worked out, though. Just add a number in the fourth entry of the BASEHITCHANCE table, making it "artillery". But yeah, perhaps we can find a way to work it arround. It would be worthy it... A working charging effect for Nexus.
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version