Nexus Modding > Scripting

Scripting Issues

<< < (12/25) > >>

Mularac:
A question: Anyone know how the devs managed to detect when a ship was disabled and add that to the winning conditions (instead of wrecking it)?

Arparso:
Don't know how the devs did it, but it's certainly possible to detect disabled ships. The resulting script depends on your exact criteria of what disabling a ship actually means... one variant could be:


--- Code: ---RULE event CO_DeviceDestroyed
:action
E.WorkingCriticalDevices := GetFreeSel();
Select(E.WorkingCriticalDevices, S.device & S.owner=E.ship & Not(S.destroyed) & (S.shield | S.Weapon | S.main | S.secondary | S.combat | S.stealth));
If(AllNumOf(E.WorkingCriticalDevices) = 0,
Debug(E.ship, "was disabled");
);
:end
END
--- End code ---

After a device has been permanently destroyed the script checks, if there are any shields, weapons or engines left for the ship in question.

Mularac:
Great, thanks. It's funny, because I went trought the vanilla missions and couldn't find a thing....

Mularac:
hey, anybody knows how to escape the " " in a dialog file? (for example, to write a dialog that involves, inside the text the use of the " ")

Arparso:
I have no idea. If " doesn't work, use single quotation marks instead, I suppose.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version