May 14, 2024, 17:22:56

Author Topic: One Topic for All My Questions  (Read 8714 times)

Offline Camtheman

  • Recruit
  • *
  • Posts: 20
  • Karma: 0
    • View Profile
    • http://
One Topic for All My Questions
« on: January 17, 2011, 05:08:56 »
Well, instead of making a ton of topics for my questions, ill just make one. My first question.

Finally figured out how to do dialouge (I initially planned for people who played my mod to read a notepad file for backstory between/ending missions) Now it'll be much smoother.

It's all fine and dandy but how do you get it to say the name of the ship & person speaking on the dialouge box? Now it currently says ? ? ?
« Last Edit: January 17, 2011, 05:19:21 by Camtheman »

Offline Mularac

  • Lieutenant
  • ***
  • Posts: 531
  • Karma: 11
    • View Profile
Re: One Topic for All My Questions
« Reply #1 on: January 17, 2011, 06:30:18 »
If you want to display the ship's name it's quite easy, just pass the ship as the second parameter of the dialog command.

in example:

Code: [Select]
Dialog("my_dialog", m.my_ship,0);
m.my_ship is your ship's variable.

But that way you'd still won't be able to display the characters name.
so, option number 2:

In the entities section of your mission, find your ship information and add a "NPC" tab, and in there, the characters that would appear in your dialogs, in this fashion, as shown in the demo mission currently available in the wiki http://nexusthegame.net/wiki/Demo_mission :

Code: [Select]
SHIP
Name "Hawkeye"
Race #race_Player
ShipType #styp_ep6_Siege_Battleship
Position -1000 838 -8966
Orientation 0 0 0

NPC
Name "Johan Mastropiero"

ID 1
Face 20
Rank 3
Medals ;
CrewLevel 1
Skill 1 0
Skill 2 0
Skill 3 0
XP 0
END
END

Then use the ID value when writing the dialogs, pasting it in the NPC tag, like this:

Code: [Select]
Dialog
name demo_2
Layout 4
NPC 1
distort -1
text
{
0 "Well, everything but the fact that the extremely comptent fellows at the station forgot to load up our torpedoes."
}
END

That way when you issue the command Dialog("Demo_2",0,0); a dialog box will appear, saying: Johan Mastropiero from Hawkeye.

You can find more information following this tutorial: http://nexusthegame.net/wiki/Mission_Making_Tutorial
and just reading these articles: http://nexusthegame.net/wiki/Beginner's_Guide

Oh, and yeah, I think it'll be best if you do make a bunch of threads for your questions
« Last Edit: January 17, 2011, 06:32:27 by Mularac »

Offline Camtheman

  • Recruit
  • *
  • Posts: 20
  • Karma: 0
    • View Profile
    • http://
Re: One Topic for All My Questions
« Reply #2 on: January 17, 2011, 09:29:27 »
Great! Perfect. Now people wont have to read pages of notepad to get what's happening.



Already answered two of my questions, ( I forgot how to make the NPC's show up in the ship's little box). Since I already remember the gist of the tacticstypes editing and efx editing I probably wont have a huge amount of more questions. thx a lot.

EDIT

How do you make things allied to you? How do you make already damaged/disabled ships? How do you script it to come over to your side after interaction with a Commando squad?
« Last Edit: January 17, 2011, 18:00:41 by Camtheman »

Offline The Old Dragon

  • Ensign
  • ***
  • Posts: 362
  • Karma: 6
    • View Profile
    • http://
Re: One Topic for All My Questions
« Reply #3 on: January 22, 2011, 10:37:09 »
Hi Cam,

Easy one first, to create an already damaged ship...

Give the ship it's own identifier, i.e. "M.DamagedShip".
Then in the scene init, use the command=
M.DamagedShip:=**;
Where "**" is the level of damage in percentage (be aware that setting this above 75-80% (or maybe a bit less) will probably result in a 'dead' ship!).

Making allies...
If the ships in question are allied at the start of the mission, than it's back to the scene init rule with the commands=

SetRelation(#race_Player,race_ISA,*);
Setrelation(#race_ISA,race_Player,*);


And set '*' to either 1,4 or 5. This will make them all nice and friendly.

You can use these commands during the mission to change the target race relation as well.

Now the really awkward one. I did briefly look into this one a while ago, but it quickly becomes quite a thorny issue.

Here is the code at it's simplest level (useing standard TacticTypes.ini) and it only handles one commando unit at a time...

Code: [Select]
MACHINE "Boarding"

  /////////////
//S:default//
/////////////

STATE Default

RULE event Launched

condition E.ship:race=#race_Player

:action

M.Launcher:=E.ship:owner;
Debug("M.Launcher is", M.Launcher);
Comm:=GetFreeSel();
//SelectBoats(Comm,S.race=#race_Player);
SelectDevices(Comm,M.Launcher,InSet(S.this,25)|InSet(S.this,143));
//S.this:devtype=#weap_cyborg);
Dump(Comm);

M.Comm1:=Pick(Comm);
Debug("Comm1 is", M.Comm1);

:end //end action

END //end rule

RULE event Breached

condition E.Ship:launcherweapon:race=#race_Player&E.Location=E.Ship:launcherweapon:Target

:action

//If our marines board the target, then give us control.

Debug("Marine target is", M.Comm1:target);

M.MTarget:=M.Comm1:Target;
Dump(M.MTarget);

M.MTarget:race:=#race_Player;

Debug(M.Mtarget, "race is", M.MTarget:race);

:end //end action

END //end rule

END //end state

END //end machine

Once your marines board, the ship instantly becomes yours. In order to make this more realsitic (i.e. your marines fight for control of the ship), then you've got to try and script a timer that your marines have to stay aboard and not get wiped out (in original N:TJI, your boarding parties were slowly killed off according to the security settings in the tactictypes.ini).
Better to look the fool by asking, then prove them right with ignorance.

Offline Mularac

  • Lieutenant
  • ***
  • Posts: 531
  • Karma: 11
    • View Profile
Re: One Topic for All My Questions
« Reply #4 on: January 22, 2011, 18:07:46 »
Small edit of Old Dragon's post:

The command to damage a ship is not:

M.DamagedShip:=**;

but actually:

M.DamagedShip:damage:=**;

And on the second thing, the "#" should go behind any constant, like "race_player", or "race_ISA", so instead of:


SetRelation(#race_Player,race_ISA,*);
Setrelation(#race_ISA,race_Player,*);


It should be:


SetRelation(#race_Player,#race_ISA,*);
Setrelation(#race_ISA,#race_Player,*);


Or the game would take "race_ISA" and "race_player" as variables instead of constants. There won't be an error, but unless you've actually declared those variables before it would be the same as:


SetRelation(#race_Player,0,*);
Setrelation(#race_ISA,0,*);


Also, isn't E.Location=E.Ship:launcherweapon:Target in your breached rule's condition a tautology?

And I don't see why you made such a lenghty code for something as simple as this:
Code: [Select]
Rule event Breached
condition e.ship:launcherweapon:race=#race_Player  //e.ship the commando unit, e.location the breached ship
:action
e.location:race:=#race_player;  //We change the breached ship's race to player, as if the commandos took over
WeaponMode(e.ship:launcherweapon, 0, e.ship:owner); //we send the commandos back home
:end
END

or even better:

Code: [Select]
Rule event Breached
:action
e.location:race:=e.ship:launcherweapon:race; //We change the race of the breached to ship to the one of the commandos.
WeaponMode(e.ship:launcherweapon, 0, e.ship:owner); //we send the commandos back home.
:end
END
« Last Edit: January 22, 2011, 18:31:43 by Mularac »

Offline The Old Dragon

  • Ensign
  • ***
  • Posts: 362
  • Karma: 6
    • View Profile
    • http://
Re: One Topic for All My Questions
« Reply #5 on: January 22, 2011, 22:56:45 »
Hi Mularac,

You're certainly right on the corrections, guess I'm a bit 'rusty' at mission scripting (haven't really done much in the last year). So thank you for correcting me.
About the lengthy coding, the script was the result of some experimenting a couple of years back.  ;)
Better to look the fool by asking, then prove them right with ignorance.

Offline Mularac

  • Lieutenant
  • ***
  • Posts: 531
  • Karma: 11
    • View Profile
Re: One Topic for All My Questions
« Reply #6 on: January 23, 2011, 01:57:16 »
Sure. Hey, how's the work on the NTAA? Been a while since I heard something about that mod

Offline The Old Dragon

  • Ensign
  • ***
  • Posts: 362
  • Karma: 6
    • View Profile
    • http://
Re: One Topic for All My Questions
« Reply #7 on: January 26, 2011, 23:37:31 »
Been very quiet I'm afraid, spending most of my time in the modelling world at the mo... must get back to soon.

@Cam

Sorry for hijacking your thread.
Better to look the fool by asking, then prove them right with ignorance.