Mission Editing! -1 reply

Please wait...

Kophjaeger

GF Pwns Me!

50 XP

6th February 2009

0 Uploads

58 Posts

0 Threads

#1 9 years ago

So I think I am set up to make a mission. Comfortable with the map editor, have the recommended C++ and editing tool. I have made things resembling missions. The problem is I open the script file and from one mission to the next I am a bit overwhelmed and confused. Where do I go from here? I noticed a few months back a link to an old forum which had a compilation of all the commands Legacy uses. Does anyone have a copy of that list? Some specific q's: I have been doing ok with making a map and 100 ships on two teams. Press 5, point at a badguy and we have a brawl, but I want to make things move on their own too. Many of the scripts I have read say ALLY_TEAM = 3. Whats the difference between doing that and setting all ships to team 1?




gdata

Who needs a user title?

50 XP

10th January 2007

0 Uploads

1,588 Posts

0 Threads

#2 9 years ago

Read the tutorials on Legacy Files, I tried to explain the programing logic there. ALLY_TEAM = 3 is variable (which has been declared as integer before: int ALLY_TEAM), so whether you write ALLY_TEAM or 3 doesn't make a difference. You don't set the allied team using this variable, but it helps keeping the code clean, when specific functions demand a team number and you just insert the variable. If you set all ships to team 1 you will have a huge mess on your map, and it will be too easy. I recommend setting the other 46 ships on team 3 and implementing a rule, that keeps adding new ships from team 3 to team 1 if you loose them in the player team. So, as I said, check my latest tutorial, it contains an intensively commented template that will help you to understand the basics. Also the file \includes\scriptinterface.h contains a list of all functions that can be used.




Guest

I didn't make it!

0 XP

 
#3 9 years ago

I'm guessing your refering to the modified ScriptInterface I may have posted a link to at one point on bethsoft. I used to have that up on the bethsoft stl mission editor wiki site which they shut down. I still have the pages from the site but never rebuilt the wiki, not without a host. maybe I could at our CJG wiki site, i've just have so many things going on sometimes I never get back to that kind of thing.




gdata

Who needs a user title?

50 XP

10th January 2007

0 Uploads

1,588 Posts

0 Threads

#4 9 years ago

If you want I can easily set up a wiki for you on stl-central.com, we've still got some free space there.




Kophjaeger

GF Pwns Me!

50 XP

6th February 2009

0 Uploads

58 Posts

0 Threads

#5 9 years ago

Thanks guys. I am sure I am not the only one who is a bit lost on scripting. Sometimes just knowing where to look for info (like the script interface files, TY) is a maddening process for those of us who don't know. ODF's and even xml's are easy to learn by imitation, this is a wide open field though. I am new to C++ so I guess understanding what the variables mean would be a great help. What needs to be set up in Definitions, Initialization, and the other actions? What is hot_int vs int vs timer_int? What are handles good for (when are they needed)? Basics will help the commands make much more sense. A couple other q's, how do I make ship selection race specific, or even ship specific? I noticed in TB2 the Klingon civil war you can only pick a BOP and Vorcha. Is this on the Start Location set up on the map? Also, in the third window of script compilation (after the two unimportant ones), I get " C:\Program Files (x86)\Bethesda Softworks\Legacy Alliance\missions\STL14>cl.exe STL14s.cpp /O2 /Ob1 /I "..\..\Include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_WINDLL" /D "_CRT_SECURE_NO_WARNINGS" /GF /FD /EHsc /MT /Gy /W3 /nologo /c /errorReport:prompt STL14s.cpp" Is this an error or is this normal? It happens for all missions (stock too), so I am just trying to make sure everything is working right first. Again, thanks for the help and tips




MARKYNCC

NG-Mods Mission Creator

50 XP

27th May 2009

0 Uploads

148 Posts

0 Threads

#6 9 years ago

Your handles are what you use to control your map objects. If you have placed a ship on your map double click on the ship, the second line down is called label. This is what you input into the script file as a handle, you can type anything into this box so long as you use it in your script. eg, say for example you put the Enterprise A on your map, look at the label by default I think it is Enterprise_ NCC1701_A or something like that, (cant remember exactly). Create a point on the map a short distance from the ship call it 'point1'.

Go into your script file then near the top in the definitions section input these two Handles:

Handle Enterprise_NCC1701_A Handle point1

Lower down you need to initialise these handles input these lines in initialisation:

Enterprise_NCC1701_A = GetHandle( "Enterprise_NCC1701_A"); point1 = GetHandle("point1");

Bear with me there is a point to all this!!

Now comes the more interesting bit!

Now that you have these Handles you can issue instructions via script, so if we wanted our ship to move from where it is to "point1":

SetSpecialForcesFlag(Enterprise_NCC1701_A, 1); PointAt(Enterprise_NCC1701_A, "point1"); Goto(Enterprise_NCC1701_A, "point1", false); (if you input "true", the ship will warp to "point1") SetSpecialForcesFlag(Enterprise_NCC1701_A, 0);

This will make the ship move at full impulse from where you placed it to "point1".

There are many things you can do with your ships and map objects, but you need to use the Handles in order for it to work.

Hope this helps.




Kophjaeger

GF Pwns Me!

50 XP

6th February 2009

0 Uploads

58 Posts

0 Threads

#7 9 years ago

Alot in fact. Can a handle be set for multiple objects? Can fleets be controled in the same. I also presume that "SetSpecialForces" temporarily allows the object to follow diect script control, then you turn it off when you're done..?




MARKYNCC

NG-Mods Mission Creator

50 XP

27th May 2009

0 Uploads

148 Posts

0 Threads

#8 9 years ago

Up to now, I haven't tried to use the same Handle for multiple objects, This could lead to problems, such as multiple ships travelling to one point it would be like a motorway pileup!!

When I made the 'Yesterdays Enterprise' mission, because I had 3 enemy ships, I found that a bit of variation makes the mission more interesting.

You need to set the relations between teams, so that when you start the mission everyone knows who their enemy is!

SetRelation( 1,2, TEAM_ENEMY ); SetRelation( 1,3, TEAM_ALLY ); SetRelation( 2,1, TEAM_ENEMY ); SetRelation( 2,3, TEAM_ENEMY ); SetRelation( 3,1, TEAM_ALLY ); SetRelation( 3,2, TEAM_ENEMY );

This way any map object that you make as "team 3" will be your ally and vice versa, any object that you make "team 2" will always be yours and your ally's enemy etc. If you give every object a different Handle, You can have enemy vessels attack different targets:

Providing that the enemy objects that you placed on the map are assigned to the enemy team, which is usually 2, but doesnt have to be.

You know about Handles from what I said earlier.

assume for instance that you have three teams Enemy, Ally, Player.

You can instruct the enemy team to attack you (the player) like this:

I will make up some fictional Handles, ie 'enemy1', 'enemy2', 'ally' and 'player':

you can get enemy1 to attack you like this:

SetSpecialForcesFlag(enemy1, 1); Attack(enemy1, player); SetSpecialForcesFlag(enemy1, 0);

The enemy ship will now atack you

at the same time

you can make the other enemy ship attack your ally:

SetSpecialForcesFlag(enemy2, 1); Attack(enemy2, ally); SetSpecialForcesFlag(enemy2, 0);

you and your ally will now be attacked by different enemies, the enemy ships will keep attacking you until destroyed.




MARKYNCC

NG-Mods Mission Creator

50 XP

27th May 2009

0 Uploads

148 Posts

0 Threads

#9 9 years ago

following on from what you asked earlier:

When the 3rd window appears If the Top section says NO WARNINGS then your Script file was correct and will be in the missions folder in Legacy, also If you look lower down (all being well) You will see another message that will say NO WARNINGS, this relates to your Rule file. If you have made any errors, NO WARNINGS will not be displayed, and a list of the errors you have made will appear, such as missing brackets or missing semi-colons, or a complete cockup!!




Guest

I didn't make it!

0 XP

 
#10 9 years ago

Here is the header. The missing part is the rest of the \Star Trek Legacy\Includes\scriptinterface.h itself. This tells you a little bit about what the santax references in there mean.

As for hosting it again somewhere that's fine, I just don't have much time to do any updating but I could get the previous pages back to what they were for the most part.

==Legacy Script Interface==

-This is a slightly reformatted copy of the "scriptinterface.h" file. To help make things a bit more readable. It's not much but it's a start. I haven't really referenced any functions that didn't have comments already. Some functions are simple enough to understand while others are a bit more complicated.

==VariableTypes== These are some of the types of "results" you can get from various functions:

int = Integer a Whole number 1 or 2 or 30,452,345 float = a Fractional number 1.3 0.12 or 23423.3421. When used for functions such as ShieldHealth, 1.0 = 100% while .01 = 1% and .99 = 99% char = Characters. Alpha Numeric and Symbols. Char[50] = a variable that holds up to 50 letters/numbers/symbols. Such as "USS Enterprise, Ncc-1701" would fit into a Char[24] (if I counted right) Position = Vector 3 Name = char* Handle = int TeamNum = int Time = float Distance = float Void = An Action without any “value” returned Vector3 = 3 part float, this gives you a 3d location on a map, also used for Velocities. X, Y, and Z Axis

Anything you get a "value" or "result" from can be used as a compare in "If", "While" "For" and other Logic test statements. The commands with a "void" result are generally functions that actually do something. Where "IsExploding(HANDLE)" is a true or false "check" that returns a 1 if it's True and a 0 if it's False. While "DestroyShip(HANDLE)" is a function that makes the ship explode..

==UseTypes== kUseType_Hail //Used for "Hailing" functions and checks kUseType_Scan //Used for "Scanning" functions and checks kUseType_Board //Used for "Transporting" functions and checks kUseType_Extra1 //Used for the "Tractorbeam" kUseType_Extra2 //Might not do anything? kUseType_Extra3 //Might not do anything?

==DamageTypes== These are used by the "ApplyDamageEffect" function kDamageType_Photon //Creates visual photon type damage on the ship kDamageType_Phaser //I suspect it is to create Phaser visual damage, but I have been unable to get results kDamageType_Fragment //Seems to sometimes knock ships "breaknodes" off, not real reliable kDamageType_Temp1 //Might not do anything? kDamageType_Temp2 //Might not do anything?

==SpecialChecks== ALWAYS_EVALUATE() isCineractiveCancel() isCineractiveDone()