Nexus Modding > Scripting

Shields that prevent their parent ship from firing

(1/2) > >>

Keldane:
Would it be possible to create, and if so how would I go about implementing, a set of shields that prevent their parent ship from firing when active?

As some background for the question, in my mod, shields typically take the form of energy screens that cause incoming laser weapons to "bloom" just before impact and in so doing vastly reduce the damage they deal. In the case of a "full defense mode" shield, however, it would actually fully stop and absorb incoming fire, at the expense of also absorbing outgoing shots within its area of effect. Thus, as long as they're up, they prevent their parent ship from being damaged, while also preventing it from attacking - perfect as a "decoy ship" thrown into the AI fleet to draw their fire while the rest of the fleet moves into place, for example. Of course, such would work against the default AI, but would only work against the AI I intend to create for the mod if you keep all other ships out of sight, but that's a matter for a different thread.

Edit: Instead of asking one specific question per thread, and thus likely overwhelming this area with my learning process, I'll limit it to a single thread and post a new question here whenever a new issue comes up.

Mularac:
Yes, it could be easily be done.
1) Create a regular shield that would those specs (forget about the ship being prevented from firing and all)
2) Create a machine that, when the shield is up, it would effectibly disable all weapons of a given ship (if you need help with as well, let me know. It's not too hard at all)

Keldane:
I had figured that would be what was necessary to make it work. I'll try to get it on my own first, and if I can't figure it out by this time tomorrow, I'll come back and ask for help.  :D

Arparso:

--- Quote ---Edit: Instead of asking one specific question per thread, and thus likely overwhelming this area with my learning process, I'll limit it to a single thread and post a new question here whenever a new issue comes up.
--- End quote ---
Actually, I'd prefer opening a new thread for each new question, if it doesn't already fit thematically in the current thread. Having one giant thread filled with dozens of questions and answers dealing with all kinds of topics, it's hard for other people to find the information they're looking for.

Keldane:
Sure thing, Arparso. Topic title changed to reflect that.  :D

Anyway, here's what I came up with for my machine. It works - except that it applies itself to every ship that has shields, rather than just ships with the shld_fulldef device.

--- Code: ---MACHINE "fdevshld"
STATE watch
RULE event ShieldUp
Condition e.shield:=#shld_fulldef
:action
Weapons:=GetFreeSel();
SelectDevices(Weapons,e.ship,InSet(s.this,31)|InSet(s.this,32)|InSet(s.this,39));
Execlist(Weapons,enabledevice(s.this,0));
:end
END

RULE event ShieldDown
Condition e.shield:=#shld_fulldef
:action
Weapons:=GetFreeSel();
SelectDevices(Weapons,e.ship,Inset(s.this,31)|InSet(s.this,32)|InSet(s.this,39));
Execlist(Weapons,enabledevice(s.this,1));
:end
END
END // STATE watch
END // MACHINE fdevshld
--- End code ---

Navigation

[0] Message Index

[#] Next page

Go to full version