Help with NPC please.

The place to discuss scripting and game modifications for X Rebirth.

Moderators: Moderators for English X Forum, Scripting / Modding Moderators

UniTrader
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 14571
Joined: Sun, 20. Nov 05, 22:45
x4

Post by UniTrader » Mon, 8. Feb 16, 00:43

alexalsp wrote:Ok. Thank you.

I noticed, if use

Code: Select all

select faction="faction.random"
NPC generated different supplies.

The captain may be: NPC trader and etc. but have the status - Captain. ))

I will try your code.

:roll:
thats probably because faction.random is not a valid expression, so it resolves to null (with an error to the debuglog) and since you didnt specify any faction it defaults to a random valid value..
if not stated otherwise everything i post is licensed under WTFPL

Ich mache keine S&M-Auftragsarbeiten, aber wenn es fragen gibt wie man etwas umsetzen kann helfe ich gerne weiter ;)

I wont do Script&Mod Request work, but if there are questions how to do something i will GLaDly help ;)

User avatar
alexalsp
Posts: 1823
Joined: Fri, 18. Jul 14, 05:28
x4

Post by alexalsp » Wed, 10. Feb 16, 23:33

Another problem.
after some time, the designated NPC spontaneously leave the ship. :?

Code: Select all


    <cue name="vsl_defencecontrol">
        <conditions>
           <event_cue_signalled/>
        </conditions>
	  <actions>
           <find_object_component name="$DockingBay" class="class.dockingbay" object="player.primaryship" /> 
             <create_platform_actor name="$Actor" dockingbay="$DockingBay" type="entitytype.defencecontrol"> 
               <owner exact="faction.player"/> 
                <select faction="[faction.plutarch,faction.heartofalbion, faction.argongovernment,faction.canteran, faction.jonferson,faction.familyryak,faction.teladi].random" tags="tag.defencecontrol"/> 
                   <skills> 
                       <skill type="boarding" min="2" max="5" /> 
                       <skill type="combat" min="5" max="5" /> 
                       <skill type="engineering" min="2" max="5" /> 
                       <skill type="leadership" min="5" max="5" /> 
                       <skill type="management" min="2" max="5" /> 
                       <skill type="morale" min="5" max="5" /> 
                       <skill type="navigation" min="3" max="5" /> 
                      <skill type="science" min="5" max="5" /> 
                  </skills> 
            </create_platform_actor> 
            <add_actor_to_playership actor="$Actor"/> 
      </actions>
    </cue>

UniTrader
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 14571
Joined: Sun, 20. Nov 05, 22:45
x4

Post by UniTrader » Thu, 11. Feb 16, 01:11

not entirely sure, but maybe the npc timed out or is just persistent in the zone until hired... best take a loop in the NPC_****-MDScripts which manage this stuff..
if not stated otherwise everything i post is licensed under WTFPL

Ich mache keine S&M-Auftragsarbeiten, aber wenn es fragen gibt wie man etwas umsetzen kann helfe ich gerne weiter ;)

I wont do Script&Mod Request work, but if there are questions how to do something i will GLaDly help ;)

User avatar
YorrickVander
Posts: 2702
Joined: Tue, 29. Oct 13, 21:59
x4

Post by YorrickVander » Thu, 11. Feb 16, 01:34

For my own hire npcs script I assign everything to their post directly. The only issue so far is managers for stations - something I have done causes CTD when sending them direct to position. You might consider this spawn to skunk > assign to postition a workaround for that case only.
X Rebirth - A Sirius Cybernetics Corporation Product

Split irritate visiting pilot with strange vocal patterns.

User avatar
alexalsp
Posts: 1823
Joined: Fri, 18. Jul 14, 05:28
x4

Post by alexalsp » Wed, 2. Mar 16, 05:58

NPC added, are currently working.

Maybe someone come in handy. NPC at the skunk and destination on ships and stations.

Code: Select all


           <find_object_component name="$DockingBay" class="class.dockingbay" object="player.primaryship" /> 
               <create_cue_actor name="$Architect" cue="this">
                   <select faction="faction.heartofalbion" tags="tag.architect"/>
                   <owner exact="faction.player"/>
                   <skills> 
                  <skill type="boarding" exact="3" />
                   <skill type="combat" exact="5" />
                   <skill type="engineering" exact="5" />
                   <skill type="leadership" exact="4" />
                   <skill type="management" exact="5" />
                   <skill type="morale" exact="5" />
                   <skill type="navigation" exact="5" />
                   <skill type="science" exact="3" />
                  </skills> 
               </create_cue_actor>
	   <set_skills_visible entity="$Architect" visible="true" /> 
			   
        <set_entity_type entity="$Architect" type="entitytype.architect"/>
        <add_actor_to_playership actor="$Architect"/>
        <signal_cue_instantly cue="md.NPC_Architect.Base" param="[$Architect, false, true]"/>

Code: Select all

           <find_object_component name="$DockingBay" class="class.dockingbay" object="player.primaryship" /> 
               <create_cue_actor name="$DefenceNPC" cue="this">
                   <select faction="faction.heartofalbion" tags="tag.defencecontrol"/>
                   <owner exact="faction.player"/>
                   <skills> 
				<skill type="boarding" exact="1"/>
				<skill type="combat" exact="5"/>
				<skill type="engineering" exact="3"/>
				<skill type="leadership" exact="5"/>
				<skill type="management" exact="4"/>
				<skill type="morale" exact="5"/>
				<skill type="navigation" exact="5"/>
				<skill type="science" exact="5"/>
                  </skills> 
               </create_cue_actor>
	   <set_skills_visible entity="$DefenceNPC" visible="true" /> 
			   
        <set_entity_type entity="$DefenceNPC" type="entitytype.defencecontrol"/>
        <add_actor_to_playership actor="$DefenceNPC"/>
        <signal_cue_instantly cue="md.NPC_Staff.CustomStaff" param="[$DefenceNPC, 15000Cr]"/>

Code: Select all

           <find_object_component name="$DockingBay" class="class.dockingbay" object="player.primaryship" /> 
               <create_cue_actor name="$Engineer" cue="this">
                   <select faction="faction.heartofalbion" tags="tag.engineer"/>
                   <owner exact="faction.player"/>
                   <skills> 
				<skill type="boarding" exact="3"/>
				<skill type="combat" exact="5"/>
				<skill type="engineering" exact="5"/>
				<skill type="leadership" exact="4"/>
				<skill type="management" exact="4"/>
				<skill type="morale" exact="5"/>
				<skill type="navigation" exact="3"/>
				<skill type="science" exact="4"/>
                  </skills> 
               </create_cue_actor>
			   <set_skills_visible entity="$Engineer" visible="true" /> 
			   
        <set_entity_type entity="$Engineer" type="entitytype.engineer"/>
        <add_actor_to_playership actor="$Engineer"/>
        <signal_cue_instantly cue="md.NPC_Engineer.CustomEngineer" param="[$Engineer, 15000Cr]"/>
        <assign_engineer actor="$Engineer" object="player.primaryship" />
        <start_script object="$Engineer" name="'engineer.player'" />

Code: Select all

           <find_object_component name="$DockingBay" class="class.dockingbay" object="player.primaryship" /> 
               <create_cue_actor name="$Commander" cue="this">
                   <select faction="faction.argongovernment" tags="tag.commander"/>
                   <owner exact="faction.player"/>
                  <skills> 
				<skill type="boarding" exact="1"/>
				<skill type="combat" exact="5"/>
				<skill type="engineering" exact="3"/>
				<skill type="leadership" exact="5"/>
				<skill type="management" exact="4"/>
				<skill type="morale" exact="5"/>
				<skill type="navigation" exact="5"/>
				<skill type="science" exact="5"/>
                  </skills> 
               </create_cue_actor>
	   <set_skills_visible entity="$Commander" visible="true" /> 
 			   
        <set_entity_type entity="$Commander" type="entitytype.commander"/>
        <add_actor_to_playership actor="$Commander"/>
        <signal_cue_instantly cue="md.NPC_Staff.CustomStaff" param="[$Commander, 15000Cr]"/>            

Code: Select all

           <find_object_component name="$DockingBay" class="class.dockingbay" object="player.primaryship" /> 
               <create_cue_actor name="$Commander" cue="this">
                   <select faction="faction.argongovernment" tags="tag.pilot"/>
                   <owner exact="faction.player"/>
                  <skills> 
				<skill type="boarding" exact="1"/>
				<skill type="combat" exact="5"/>
				<skill type="engineering" exact="3"/>
				<skill type="leadership" exact="5"/>
				<skill type="management" exact="4"/>
				<skill type="morale" exact="5"/>
				<skill type="navigation" exact="5"/>
				<skill type="science" exact="5"/>
                  </skills> 
               </create_cue_actor>
	   <set_skills_visible entity="$Commander" visible="true" /> 
 			   
        <set_entity_type entity="$Commander" type="entitytype.pilot"/>
        <add_actor_to_playership actor="$Commander"/>
        <signal_cue_instantly cue="md.NPC_Staff.CustomStaff" param="[$Commander, 15000Cr]"/>            

Code: Select all

  
           <find_object_component name="$DockingBay" class="class.dockingbay" object="player.primaryship" /> 
               <create_cue_actor name="$Manager" cue="this">
                   <select faction="faction.canteran" tags="tag.manager"/>
                   <owner exact="faction.player"/>
                  <skills> 
				<skill type="boarding" exact="1"/>
				<skill type="combat" exact="5"/>
				<skill type="engineering" exact="3"/>
				<skill type="leadership" exact="5"/>
				<skill type="management" exact="5"/>
				<skill type="morale" exact="5"/>
				<skill type="navigation" exact="5"/>
				<skill type="science" exact="5"/>
                  </skills> 
               </create_cue_actor>
	   <set_skills_visible entity="$Manager" visible="true" /> 
 			   
        <set_entity_type entity="$Manager" type="entitytype.manager"/>
        <add_actor_to_playership actor="$Manager"/>
        <signal_cue_instantly cue="md.NPC_Staff.CustomStaff" param="[$Manager, 15000Cr]"/>            



Post Reply

Return to “X Rebirth - Scripts and Modding”