Page 1 of 1
commsMessage:
Posted: Sat Jan 13, 2007 6:22 am
by Twisted
How do you use a commsMessage: method in an ai text plist?
"commsMessage: AMessageWithNoSpaceWorks"
I've tried a lot of workarounds to to get it to comm a message including spaces but don't ever receive any message.
Posted: Sat Jan 13, 2007 9:45 am
by LittleBear
Need a "commsMessage: [my-message]", Eg Like this in AI:-
Code: Select all
"ENERGY_LOW" = (setTargetToPrimaryAggressor, "commsMessage: [victim1-plea]", "setStateTo: SHUTDOWN");
This will send a Comms Message randomly picked of the list defined as [victim1-plea].
In descriptions.plist define the messages like this:-
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>victim1-plea</key>
<array>
<string>Squeak! This ship's a vintage classic! Leave me alone!</string>
<string>Squeak! Mind the paintwork on my ship, bud!</string>
<string>Squeak! Stop it! I'm on holiday!</string>
<string>Squeak! I'm a ship designer. Let me live and I'll build you a Classic!</string>
<string>Squeak! Mercy! I have no enemies! I'm just a retired designer!</string>
<string>Squeak! I do a lot of good work for charity! Leave me alone!</string>
<string>Squeak! Think of my wife and litter! Let me live!</string>
<string>Squeak! The Soin Clan will make you pay for this!</string>
</array>
</dict>
</plist>
Posted: Sat Jan 13, 2007 10:17 am
by Charlie
Hi LB,
Raises a related question that's been causing me grief ( well not that bad )
Most of my ships use the comm-hail method you state as part of their death_actions - works fine...
I've also added the same to the death_actions of their sub-enities. ( 'oo - there goes my my leg, oo - there goes the other one', that sort of thing )
But,
No coms message. ( no errors either )
I have sucessfully used death_actions for s-e's under other circumstances, though not everything seems to work.
Any ideas?
Ta.
Posted: Sat Jan 13, 2007 10:31 am
by LittleBear
Have used comms messages under death_actions for the Main entry but not tried it with sub-entries.
I comms-message under death_actions usually works but not always (EG the Native Thargoids don't always send a Thargoid Curse).
Not sure why this is, but I don't see why it should be any less reliable with a sub-entry death. A workaround could be to give the sub-entry a simply AI that just had:-
Code: Select all
"ENERGY_LOW" = ("commsMessage: [damaged]", becomeExplosion);
The sub-entry (should) then when on energy low send the message and then blow up. If you boosted the energy a little bit to allow for this, then the effect should be the same.
[/code]
Posted: Sat Jan 13, 2007 10:48 am
by Charlie
Thanks for the swift reply...
Been thinking on those lines, but given how much trouble I've been having getting my Orb.oxp to work, guess I have accept my scripting remains p-poor!
( Orb now working - sort-of - so soon to re-release, but under some circumstances can realy slug my system. Probably as a function of the way I've implented it to avoid scripting as much as possible. Hopefully as a result there will be posts on that thread other than me & my sock-puppet - sounds like a song )
Posted: Sat Jan 13, 2007 1:21 pm
by Twisted
Charlie wrote:Most of my ships use the comm-hail method you state as part of their death_actions - works fine...
I've also added the same to the death_actions of their sub-enities. But, No coms message. ( no errors either )
I have sucessfully used death_actions for s-e's under other circumstances, though not everything seems to work.
Any ideas?
Just talking out of my hat, but it might be worth a try doing something silly like this. Assign the sub entities as escorts. Use a messageMother. Perhaps this can trigger a state change in your main entity that you can use to broadcast your message?
Posted: Sun Jan 14, 2007 11:49 pm
by Charlie
@ Twisted:
Hmmm - worth a try...
Ta
Posted: Mon Jan 15, 2007 12:07 am
by LittleBear
I can't get sub-entries folowing an AI at al!
No biggey. THe Black Monk Bases will just be surrounded by a field of minesweeper satilaties as main entries!