Jump to content

GRAW SP Scripting 2


Recommended Posts

Ok. Another one. :shifty:

Mission Objectives In The User Interface

NOTE: You can add as many elements as you want in these events. Everything you want to happen when the objective starts and ends should be put into these events.

Create Event To Add A Mission Objective To The GUI

<event name="add_objective1">

Add Objective Info

<element type="Objective" id="objective1" headline_id="my_mission_head_obj1" txt_id="my_mission_txt_obj1" state="add" mode="1" start_time="1.0/>

- type => define that you're dealing with an objective

- id => name for this element inside the script, used for deactivating and changing info

- headline_id => which string entry to show as headline for objective, example "Search and destroy ADA unit"

- txt_is => which string entry to show as description text for objective, example "Search and destroy the mobile ADA unit. Use your C4 or other explosives to neutralize it."

- state => what you want to do with the objective?, add/remove

- mode => keep this set to 1

- start_time => when to show it?, seconds delay after event executed

Add Objective CrossCom Marker

<element type="Objective" id="objective1_wp" waypoint_id="my_mission_wp_obj1" state="add" waypoint="10171.8555 -9296.7939 106.4334" mode="1" start_time="3.0"/>

- type => define that you're dealing with an objective

- id => name for this element inside the script, used for deactivating and changing info

- waypoint_id => which string entry to show as name tag for marker

- state => what do you want to do with the marker?, add/remove

- waypoint => x,y,z coordinates on map to place it

- mode => keep this set to 1

- start_time => when to show it?, seconds delay after event executed

</event>

Create Event To Update A Mission Objective On The GUI

<event name="update_objective1">

Update Objective Info

<element type="Objective" id="objective1" headline_id="my_mission_head2_obj1" txt_id="my_mission_txt2_obj1" state="add" mode="1" start_time="3.0"/>

- type => define that you're dealing with an objective

- id => define which objective you want to work with, same as id when you created it

- headline_id => which string entry to show as new headline for objective, example "Get a move on, Search and destroy ADA unit"

- txt_is => which string entry to show as new description text for objective, example "Search and destroy the mobile ADA unit. Use your C4 or other explosives to neutralize it. The ADA is on the move!"

- state => what you want to do with the objective?, add/remove, use add when updating

- mode => keep this set to 1

- start_time => when to update it?, seconds delay after event executed

</event>

Create Event To Remove Mission Objective From The GUI

<event name="remove_objective1">

Remove Objective CrossCom Marker

<element type="Objective" id="objective1_wp" state="remove" mode="1" start_time="0.0"/>

- type => define that you're dealing with an objective

- id => define which marker you want to work with, same as id when you created it

- state => what do you want to do with the marker?, add/remove

- mode => keep this set to 1

- start_time => when to remove it?, seconds delay after event executed

Remove Objective Info

<element type="Objective" id="objective1" state="remove"/>

- type => define that you're dealing with an objective

- id => define which objective you want to work with, same as id when you created it

- state => what do you want to do with the marker?, add/remove

Add Next Objective

</event>

And the clean XML code with only overview comments:

Adding A Mission Objective To The GUI

<event name="add_objective1">

<element type="Objective" id="objective1" headline_id="my_mission_head_obj1" txt_id="my_mission_txt_obj1" state="add" mode="1" start_time="1.0/>

<element type="Objective" id="objective1_wp" waypoint_id="my_mission_wp_obj1" state="add" waypoint="10171.8555 -9296.7939 106.4334" mode="1" start_time="3.0"/>

</event>

Update A Mission Objective On The GUI

<event name="update_objective1">

<element type="Objective" id="objective1" headline_id="my_mission_head2_obj1" txt_id="my_mission_txt2_obj1" state="add" mode="1" start_time="3.0"/>

</event>

Removing A Mission Objective From The GUI

<event name="remove_objective1">

<element type="Objective" id="objective1_wp" state="remove" mode="1" start_time="0.0"/>

<element type="Objective" id="objective1" state="remove"/>

</event>

NOTE: The creation of marker and info can all be done in one go!

<element type="Objective" id="objective1" headline_id="my_mission_head_obj1" txt_id="my_mission_txt_obj1" waypoint_id="my_mission_wp_obj1" state="add" waypoint="23432.975 26290.469 -1044.3226" mode="1" start_time="1.0"/>

But as you can see there is no id for just the marker defined, which gives that you can't just update the waypoint if you need to. It's all in one big package.

On the other hand your marker will get deleted with your info, using only one element.

<element type="Objective" id="objective1" state="remove"/>

So it depends on the type of objective you have which way to deal with the user interface.

The Strings

There was a few string entrys used in these scripts. These are found in the strings/mission.xml.

in our case it would be a short file like this:

<stringset>

<string id="my_mission_briefing" value="Get to it."/>

<string id="my_mission_head_obj1" value="Search and destroy ADA unit"/>

<string id="my_mission_txt_obj1" value="Search and destroy the mobile ADA unit. Use your C4 or other explosives to neutralize it."/>

<string id="my_mission_wp_obj1" value="ADA location"/>

<string id="my_mission_head2_obj1" value="Get a move on, Search and destroy ADA unit"/>

<string id="my_mission_txt2_obj1" value="Search and destroy the mobile ADA unit. Use your C4 or other explosives to neutralize it. The ADA is on the move!"/>

</stringset>

Notice that the mission briefing text is also in this file. ;)

Ok. Now all we need is triggers for these events... that's for next time.

Hope it helps any SP scripters out there.

Link to comment
Share on other sites

  • 4 weeks later...
  • 11 months later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...