Sign up Calendar Latest Topics
 
 
 


Reply
  Author   Comment  
Runekyndig

Registered:
Posts: 31
Reply with quote  #1 
I have an ideer for a Artemis mission in honor of Rosettas final mission (see link)

The asteroid P67 is heading toward the Space station Rosetta, and Artemis have to evakuate the space station before P67 hits the spacestation. Here is the tricky bit, I can't animate a generic mesh. What I can do is setting an event that will change the distance and angle to my spacestation. I will keep the angle constant, but reduce the distance until the distance is 0 and the asteroid hits. 

So this is what I did, and what I am sharing with the forum: I took the event code from my .xml script


  <event name_arme="comet step3" parent_id_arme="90caee0e-0f51-40a1-a38e-99da2af403f4">
    <if_timer_finished name="comet_step" />
    <if_variable name="comet_voyage" comparator="EQUALS" value="4.0" />
    <set_variable name="comet_voyage" value="5.0" />
    <set_relative_position name2="Comet P67" distance="93570" angle="306.0" name1="Rosetta" />
    <set_timer name="comet_step" seconds="2" />
  </event>


And I wrote a python program that would make a new event "comet step4" advance the variable "comet_voyage" by one and reduce the distance between Comet P67 and Rosetta spacestation by 100. I also made a empty text file called comet.txt


with open('comet.txt', 'a') as the_file:
  for x in xrange(1,936):
    the_file.write(('  <event name_arme="comet step%d" parent_id_arme="90caee0e-0f51-40a1-a38e-99da2af403f4">\n    <if_timer_finished name="comet_step" />\n    <if_variable name="comet_voyage" comparator="EQUALS" value="%d" />\n    <set_variable name="comet_voyage" value="%d" />\n    <set_relative_position name2="Comet P67" distance="%d" angle="306.0" name1="Rosetta" />\n    <set_timer name="comet_step" seconds="2" />\n  </event>') % (x, x+1, x+2, 93570-x*100 ))


I ran this program and it created 936 events in the comet.txt file. I could then copy-paste these 936 events into my script, and I now have a generich mesh that slowly moves towards the spacestation. With 2 sec between each step, is takes about 31 minuts to hit. I am using the ArtemisMissionEditor and this can create folders inside. I have added the "parent_id_arme" for my folder, so every 936 events are in this folder. You may have to edit the "parent_id_arme" or remove it for it to work with your mission.

I hope that you can use this for some of your own projects. I have attached my python script aswell.

 http://www.esa.int/Our_Activities/Space_Science/Rosetta/Mission_complete_Rosetta_s_journey_ends_in_daring_descent_to_comet

 
Attached Files
zip Python.zip (11.81 KB, 2 views)

Xavier Wise

Registered:
Posts: 1,141
Reply with quote  #2 
I think if you just used a 'add to property x for object P67' on a timed, repeat event, you'd get the same effect.

I have used such code to animate blackholes.

__________________
Fleet Captain Xavier Wise - TSN Sabre
Link to TSN RP Community website
Runekyndig

Registered:
Posts: 31
Reply with quote  #3 
I did not think of that, but you are right, that works to - and it is a more elegant solution [smile]
Fish Evans

Registered:
Posts: 361
Reply with quote  #4 
you can infact do it in one event and no repation of events...


<event id_arme="439c422c-305a-48f5-bc44-dbee83c6e303">
  <set_object_property property="deltaX" value="10.0" name="XXX" />
  <set_object_property property="deltaZ" value="10.0" name="XXX" />
  <set_object_property property="pitchDelta" value="0.5" name="XXX" />
  <set_object_property property="rollDelta" value="0.5" name="XXX" />
  <set_object_property property="angleDelta" value="-0.5" name="XXX" />
</event>

 
deltaX is basicly "speed of movment along X axies",  deltaZ on the Z; and the Pitch roll and angle detla values will add a "tumble" to the object. You may want to have a look at the mission "Shell Shock" that I created ontop of the origional sandbox by Xavior - Its old enough that it needs some updateing and recodifying for 2.4.0 you are more then welcome to copy and use the code in it!
Mike Substelny

Avatar / Picture

Administrator
Registered:
Posts: 2,404
Reply with quote  #5 
All three of these solutions work. The one by Fish Evans may be the most useful because it is easiest to debug, but it is also hardest to program since you need to do some precise math to ensure the comet's course is precise.

But the one where you have a distance variable that constantly contracts is super useful if the target is moving but not turning. If the target is both moving and turning you need to pin an invisible generic object to the target. The invisible generic object is also super useful if you want the players to be able to deflect the path of the comet.

__________________
"The Admiralty had demanded six ships; the economists offered four; and we finally compromised on eight."
- Winston Churchill
Fish Evans

Registered:
Posts: 361
Reply with quote  #6 
do you know if Thorm is reintrodcing the "Direct" AI command or going to look at Generic meshes at all? they seem a bit broken (opetions that are setable but cant be picked up on by the player like shield strengths etc...)
Mike Substelny

Avatar / Picture

Administrator
Registered:
Posts: 2,404
Reply with quote  #7 
I personally REALLY miss the "direct" command. Many of my scripts became impossible when he deprecated that command. I lament it to him now and then, but it's possible that "direct" cannot exist in the same world as his AI stack.

I think "direct" still works for generics, though.

Last week I talked to Thom about giving us a way for the AI stack to steer a ship toward one target while shooting at another target. I think I convinced him that our mission scripts need this capability and we might have it within a month. This would go a long way to replacing the "direct" command.

He also mentioned that he plans to give us access to the brain stacks of all the different monsters. If we have that we can write much more interesting science missions and peacetime missions.

As for generic objects, I talk with Thom about generics all the time. He always had big hopes for generic objects, but all they turned out to be are ways for our scripts to put 3-D images on the main viewer. Perhaps he didn't realize that we would want science, weapons, and communications to be able to interact with them. I remind him regularly that we want weapons to lock onto generics, science to scan generics, and comms to talk to generics with customizable messages. I hope we script writers will get those abilities soon, perhaps by next year's Armada.

__________________
"The Admiralty had demanded six ships; the economists offered four; and we finally compromised on eight."
- Winston Churchill
Fish Evans

Registered:
Posts: 361
Reply with quote  #8 
you have my support in that as well, variation and supprises rule the space lanes!
Liberty4All

Avatar / Picture

Registered:
Posts: 44
Reply with quote  #9 
So say we all! :-)
__________________
Captain - TSN Nomad
Gaming Nomads
Previous Topic | Next Topic
Print
Reply

Quick Navigation:

Easily create a Forum Website with Website Toolbox.