OFPEC Forum

Editors Depot - Mission Editing and Scripting => ArmA - Editing/Scripting Resources Beta Testing & Submission => Topic started by: johnnyboy on 10 Dec 2008, 19:55:10

Title: Replace Object so missions don't have to require Editor Addons (OBSOLETE)
Post by: johnnyboy on 10 Dec 2008, 19:55:10
To make missions more accessible to the public, its a good idea to use as few addons as you can.  This script makes it easy to use Editor Addon objects, without requiring the addons.

From the comments in the script:

; *****************************************************
; ** JBOY_replace_object.sqs
; ** by JohnnyBoy
; **
; ** Replace one object with another object.  Used to place
; ** EditorUpdate objects without having to include the Editor Addon
; ** in your mission.  The replacment object will have the same dir and
; ** position as the object to replace.
; **
; ** example call: 
; **    [this, "FieldReporter", "ReporterDude"] exec "JBOY_replace_object.sqs";

; **
; ** Parameter 1: Object to replace.  I like barrel objects as place holders.
; ** Parameter 2: Object Type of new object to create.
; ** Parameter 3: Object name of new object, so you can reference this object
; **              in your other scripts.  Place your desired name in this variable
; **              instead of naming the placeholder object you placed in the editor.
; *****************************************************

In the attached sample mission I have placed 4 barrel objects, adjusted their azimuths, and put a call to this script in the barrel's init.  When you preview the mission you will not see 4 barrels.  Instead you will see Marian Quandt, the Field Reporter, a video camera on a tripod, and an Oil Pump.

I should have posted this a year ago... :-[
Title: Re: Replace Object so missions don't have to require Editor Addons
Post by: Spooner on 11 Dec 2008, 02:41:48
I'm sorry, but you can already place ArmA's hidden objects directly in the editor without requiring the server/players to have any specific addon. Just use SIX EditorUpdate (http://www.flashpoint1985.com/cgi-bin/ikonboard311/ikonboard.cgi?act=ST;f=70;t=64542) addon while making the mission, which unlocks all that hidden content in the editor, but does not require the addon to play the mission.

Nevertheless, a good idea on its own, if there wasn't already a better system available to do this.
Title: Re: Replace Object so missions don't have to require Editor Addons (OBSOLETE)
Post by: johnnyboy on 11 Dec 2008, 03:18:17
Right on.  That is better.  My old way required you to know the name of the object, which was a pain to find.

I'm all for whatever is easiest.   :good: