CmdrNooblet
Registered:1385001400 Posts: 16
Posted 1385056855
Reply with quote
#1
Hey guys, I'm a newbie trying to make a mission with the editor. Has anyone tried the "hasSurrendered" condition? It doesn't seem to do anything in my map. I also noticed it wants a float value, while the hasSurrendered action needs a "yes/no" statement. This smells kind of buggy to me. Does anyone know what I'm talking about? I know nothing of scripts but I was getting pretty far until I hit this snag. This editor's addictive. Any feedback appreciated. Thanks, CmdrNooblet
CmdrNooblet
Registered:1385001400 Posts: 16
Posted 1385183222
Reply with quote
#2
Least I got a good 41 views. I feel special. Anyways yeah. Has anyone used the "hasSurrendered" condition before? Do they know how its value works or could present an example script where it's used successfully? Or at least let me know if I'm being numb-skulled in some detail of my question? As I said I don't do many scripts and don't know the terminology or practices. I'm trying to use the condition to alter the AI behaviour of enemy ships, have them react viscerally to their comrade surrendering. Was also planning to trigger a sound. Nothing too fancy. <if_object_property property="hasSurrendered" name="Klingon Cruiser 1" comparator="EQUALS" value="1.0" />
<add_ai type="ATTACK" targetName="Klingon Cruiser 1" value1="100.0" name="Klingon Cruiser 2" />
<add_ai type="ATTACK" targetName="Klingon Cruiser 1" value1="100.0" name="Klingon Cruiser 3" />
<play_sound_now filename="MISS_Betrayed.wav" />
<set_variable name="Klingons Attack Player" value="0.0" /> That's all the info I could think of....
CmdrNooblet
Registered:1385001400 Posts: 16
Posted 1385336612
Reply with quote
#3
Hmm... think I figured it out. The condition works, but it won't trigger until the surrendered ship slowly crawls its way back across the entire map and exits the game. Unfortunately I really wanted it to trigger as soon as the ship turns yellow, so this doesn't serve my purposes at all. I kinda wish the condition was called an "escape" variable, not surrender. I noticed there's no mention of "hasSurrender" in the Artemis Wiki as it's out of date. Does anyone know a better location to find the definitions of all these scripts? That way I wouldn't clutter your forums with my questions.
Mike Substelny
Administrator
Registered:1375273622 Posts: 2,990
Posted 1385397878
Reply with quote
#4
CmdrNooblet, the HasSurrendered condition used to work fine. I used it in my mission Truce or Consequences a couple of years ago. In that mission the only way to win was to get a certain ship to surrender. The following line used to work: <if_object_property name="God of Blades" property="hasSurrendered" comparator="=" value="1"/> If the God of Blades surrendered then the line returned true and the players won.
__________________"The Admiralty had demanded six ships; the economists offered four; and we finally compromised on eight." - Winston Churchill
CmdrNooblet
Registered:1385001400 Posts: 16
Posted 1385439121
Reply with quote
#5
Hey thanks Mike! You're right, must've been one of my other events interfering with things. Surrender's working now. If you hadn't written me I probably would've given up so thanks again. Unfortunately I have a new problem. My next step was to have the other enemies turn on the surrendered ship and blow it up. I gave them an attack command. They move in on the surrendered ship, stare it in the face, but they just can't bring themselves to shoot. I don't suppose you've ever made enemy AI of the same group attack themselves? Is there a trick?
Mike Substelny
Administrator
Registered:1375273622 Posts: 2,990
Posted 1385478032
Reply with quote
#6
CmdrNooblet, it might be possible to change the surrendered ship's side variable. I haven't experimented with that yet but if it works that would be the simplest solution. Still, there is a trick that I have used that definitely works. When the enemy gets close to the surrendered ship create a friendly ship with the same hull type and *almost* exactly the same name. Then use copy_object_property to make the copied ship's X, Y, Z, shields, engine damage, beam damage, etc. exactly match those of the surrendered ship. Finally destroy the surrendered ship. The remaining enemy ships will immediately start blasting away at the damaged copy. You should add a blank space to the end of the copied ship's name. This way the script can tell them apart, but to the Science Officer the name of the copied ship will look exactly like the surrendered ship. In my mission I had these ships: Original: "God of Blades" Copy: "God of Blades " The two names look exactly the same on Long Range Scan, Tactical, or Science.
__________________"The Admiralty had demanded six ships; the economists offered four; and we finally compromised on eight." - Winston Churchill
CmdrNooblet
Registered:1385001400 Posts: 16
Posted 1385523267
Reply with quote
#7
Ahh... good ideas! I tried changing the side of the ship with a "Set ship text" action... set the race to "2" and "friendly." Neither seemed to do anything. I like your copy-swap technique! Might try that. If players had to rescue the surrendered ship that'd be perfect. My current solution is just assigning damage and destroying the ship a few seconds after its "attacker" stares it in the face... try to sell it with dramatic audio and text. Mine's a very quick incident meant to finish before players can react, so this may be good enough, unless they're looking directly at the two ships in the main viewer. But if they're that close, even if I did a copy-swap I suppose they'd see the explosion of the original ship. And hear it. I definitely like the naming trick you mentioned. I'm sure I'll find a use for that somewhere. Appreciated. I'm fairly satisfied with the way the scenario works now. The only trouble remaining is that it can take an exhaustively long time to get the ship to surrender, even though I've set the "surrenderChance" to 100. And if the ship surrenders anywhere near the edge of the map it'll instantly exit the game before anybody can backstab it, which kills some of the drama. I can set up boxes around the edges so the ship will never surrender down there, but it's a shame to artificially constrain the player's ability just because they're in an invisible box. Ah well. Thanks again for all the tips.
Badgeguy
Registered:1375080733 Posts: 316
Posted 1385609767
Reply with quote
#8
Create the new ship, move the old ship to a new location at one of the corners of the map, then destroy it. No evidence. They'd never be able to convict you!
CmdrNooblet
Registered:1385001400 Posts: 16
Posted 1386098349
Reply with quote
#9
Hahah that is beautiful. I may have to do that. Thanks a bunch!