Help with NPC please.
Moderators: Scripting / Modding Moderators, Moderators for English X Forum
-
- Posts: 1896
- Joined: Fri, 18. Jul 14, 05:28
Help with NPC please.
Help me please.
How by the menu add to the skunk, NPC?
For example: Architect, captain, defense officer, and etc..
Menu -> Add captain
In the skunk will appear captain of the player.
How by the menu add to the skunk, NPC?
For example: Architect, captain, defense officer, and etc..
Menu -> Add captain
In the skunk will appear captain of the player.
-
- Posts: 94
- Joined: Tue, 7. Oct 14, 10:18
If I understood - you want to add crewe to your capitals right?
1. get the crew. Either dock to find them, or just call them out from space. Make sure to find the best crew you can. Captain with 5 star in navigation, Engineer with 5 stars in engineering and also a 5 star defence officer (the relevant stats are bolded out)
2. Once you find them - hire them and get them onboard the Skunk
3. Drive over to your capital and dock onto it
4. open the menu and call your crewe remotely
5. tell them to "Work here"
And you're done
1. get the crew. Either dock to find them, or just call them out from space. Make sure to find the best crew you can. Captain with 5 star in navigation, Engineer with 5 stars in engineering and also a 5 star defence officer (the relevant stats are bolded out)
2. Once you find them - hire them and get them onboard the Skunk
3. Drive over to your capital and dock onto it
4. open the menu and call your crewe remotely
5. tell them to "Work here"
And you're done

-
- Posts: 1896
- Joined: Fri, 18. Jul 14, 05:28
No.
I want, by sub-menu, add the NPC, to the skunk, for their further appointment to the station and the ships if necessary.
For example.
You are in malstrime, you captured the ship, but fly to other systems far.
Select the menu -> Add to Skunk -> Captain.
and in the cabin will appear the chosen NPC.
How assign and recruit crew, I know
I need md script))
I want, by sub-menu, add the NPC, to the skunk, for their further appointment to the station and the ships if necessary.
For example.
You are in malstrime, you captured the ship, but fly to other systems far.
Select the menu -> Add to Skunk -> Captain.
and in the cabin will appear the chosen NPC.
How assign and recruit crew, I know

I need md script))
-
- Moderator (Script&Mod)
- Posts: 14571
- Joined: Sun, 20. Nov 05, 22:45
Code: Select all
<create_platform_actor dockingbay type >
<owner exact />
<select *** />
<skills>
<skill type exact />
</skills>
</create_platform_actor>
dockingbay is in this case either player.primaryship or, if that doesnt work, try to get the skunks back romm into a var first and use that as dockingbay.
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
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

-
- Posts: 1896
- Joined: Fri, 18. Jul 14, 05:28
I tried that.
But the NPC without options.
http://prntscr.com/9zuu2p
Code: Select all
<cue name="alexalsp_Commander">
<conditions>
<event_cue_signalled/>
</conditions>
<actions>
<create_cue_actor name="$Commander" type="entitytype.commander" cue="this" ref="trader_omicron_lyrae_random" >
<skills>
<skill type="boarding" min="5" 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="1" max="4" />
<skill type="morale" min="5" max="5" />
<skill type="navigation" min="5" max="5" />
<skill type="science" min="5" max="5" />
</skills>
</create_cue_actor>
<set_entity_type entity="$Commander" type="entitytype.commander"/>
<set_owner object="$Commander" faction="faction.player"/>
<add_actor_to_playership actor="$Commander"/>
</actions>
</cue>
But the NPC without options.
http://prntscr.com/9zuu2p
-
- Moderator (Script&Mod)
- Posts: 14571
- Joined: Sun, 20. Nov 05, 22:45
there is a difference between <create_cue_actor/> and <create_platform_actor/> - the former doesnt trigger <event_platform_actor_created/> (obviously) - and the creation of the actor dialogue tree is bound to this event.
Not sure if there are further differences but i think cue actors dont trigger this because they are supposed to be given an individual dialogue tree in the Mission, and Platform Actors are mission-independent so have to signal for the regular dialogue tree on creation.
Not sure if there are further differences but i think cue actors dont trigger this because they are supposed to be given an individual dialogue tree in the Mission, and Platform Actors are mission-independent so have to signal for the regular dialogue tree on creation.
Last edited by UniTrader on Sat, 6. Feb 16, 22:04, edited 1 time in total.
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
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

-
- Posts: 5625
- Joined: Sat, 10. Nov 12, 17:55
-
- Posts: 2774
- Joined: Tue, 29. Oct 13, 21:59
This is how I spawned my npc trader for the old Shady Slater mod :
The mod has been discontinued for some time so I have no idea if it will still work in 3.61/4.00
EDIT :
As uni pointed out <create_platform_actor is probably the way to go for staff that will be assigned elsewhere. There was also a change in the way <create_cue_actor funtioned some time ago.
Code: Select all
<create_cue_actor cue="this" name="$actor" macro="character_ar_male_shadyslater_macro">
<name name="'Shady Slater'"/>
<select faction="faction.heartofalbion" tags="tag.shadyguy"/>
<owner exact="faction.heartofalbion"/>
</create_cue_actor>
<set_entity_type entity="$actor" type="entitytype.shadyguy"/>
<add_actor_to_playership actor="$actor" />
EDIT :
As uni pointed out <create_platform_actor is probably the way to go for staff that will be assigned elsewhere. There was also a change in the way <create_cue_actor funtioned some time ago.
X Rebirth - A Sirius Cybernetics Corporation Product
Split irritate visiting pilot with strange vocal patterns.
Split irritate visiting pilot with strange vocal patterns.
-
- Posts: 3617
- Joined: Sun, 8. Apr 12, 09:40
without <event_platform_actor_created /> the convarsationoptions will not assigend to the NPC it looks like
maybe it will help to trigger the code by
maybe it will help to trigger the code by
Code: Select all
<signal_cue_instantly cue="OnPlatformPopulation_Staff" param="[$actor, $fee]"/>
-
- Posts: 145
- Joined: Thu, 30. Dec 04, 15:26
-
- Posts: 2774
- Joined: Tue, 29. Oct 13, 21:59
In case it helps, I also used this sub cue when creating shady
again, no idea what will be the result for assigning a staff npc after creating the convoa this way will be.
Code: Select all
</actions>
<cues>
<!-- Start handler for default conversation -->
<cue name="DefaultComm" instantiate="false">
<conditions>
<check_any>
<event_conversation_started actor="$actor" />
<event_conversation_returned_to_section actor="$actor" />
</check_any>
<check_value value="event.param == 'default'" />
</conditions>
<actions>
<do_if value="event.name == 'event_conversation_started'">
<debug_text text="'Itemtrader conversation started: %1, actor=%2, %3'.[event.param, event.object, event.object.knownname]" />
<set_conversation_return_section section="g_goodbye" />
</do_if>
<do_else>
<add_conversation_view view="facecopilot" comment="Hide detail monitor" />
</do_else>
<add_player_choice_sub text="readtext.{1002}.{12001}" section="cItemtrader_wares" position="top_left" choiceparam="[0, 0, $actor, 'inventory', $WareList]" baseparam="event.param2" />
<add_player_choice_sub text="{1002,3004}" section="g_FireShady" position="bottom_left" comment="You\'re fired!"/>
<add_player_choice_sub text="{1002,12008}" comment="Where can I find ...?" section="g_askforway" position="top_right" baseparam="event.param2" />
<add_player_choice_return text="{1002,2}" position="bottom_right" comment="Goodbye"/>
<reset_cue cue="this" />
</actions>
</cue>
X Rebirth - A Sirius Cybernetics Corporation Product
Split irritate visiting pilot with strange vocal patterns.
Split irritate visiting pilot with strange vocal patterns.
-
- Posts: 3617
- Joined: Sun, 8. Apr 12, 09:40
-
- Posts: 419
- Joined: Wed, 11. Dec 13, 02:39
Try this, I use similar code in my random freeplay mod.
Code: Select all
<find_object_component name="$DockingBay" class="class.dockingbay" object="player.primaryship" />
<create_platform_actor name="$Actor" dockingbay="$DockingBay" type="entitytype.commander">
<owner exact="faction.player"/>
<select faction="faction.argongovernment" tags="tag.commander"/>
<skills>
<skill type="boarding" min="2" max="5" />
<skill type="combat" min="2" max="5" />
<skill type="engineering" min="2" max="5" />
<skill type="leadership" min="2" max="5" />
<skill type="management" min="2" max="5" />
<skill type="morale" min="2" max="5" />
<skill type="navigation" min="2" max="5" />
<skill type="science" min="2" max="5" />
</skills>
</create_platform_actor>
<add_actor_to_playership actor="$Actor"/>
-
- Posts: 1896
- Joined: Fri, 18. Jul 14, 05:28
Oh my God !!!Clownmug wrote:Try this, I use similar code in my random freeplay mod.
Code: Select all
<find_object_component name="$DockingBay" class="class.dockingbay" object="player.primaryship" /> <create_platform_actor name="$Actor" dockingbay="$DockingBay" type="entitytype.commander"> <owner exact="faction.player"/> <select faction="faction.argongovernment" tags="tag.commander"/> <skills> <skill type="boarding" min="2" max="5" /> <skill type="combat" min="2" max="5" /> <skill type="engineering" min="2" max="5" /> <skill type="leadership" min="2" max="5" /> <skill type="management" min="2" max="5" /> <skill type="morale" min="2" max="5" /> <skill type="navigation" min="2" max="5" /> <skill type="science" min="2" max="5" /> </skills> </create_platform_actor> <add_actor_to_playership actor="$Actor"/>
Many thanks, Clownmug
It works. I can now sleep a little bit. )))
I hope that option will work for all NPC.
Code: Select all
entitytype.commander, entitytype.engineer, entitytype.defencecontrol, entitytype.architect, entitytype.pilot, entitytype.engineer, entitytype.marine, entitytype.manager, entitytype.specialistagriculture, entitytype.specialistpowerstorage, entitytype.specialistfood, entitytype.specialistchemical, entitytype.specialistprecision, entitytype.specialistweapons, entitytype.specialistpharmaceuticals, entitytype.specialistmetals, entitytype.specialistgeophysics, entitytype.specialistsurfacesystems, entitytype.specialistpowersupply, entitytype.specialistaquatics
http://prntscr.com/a07rtj
http://prntscr.com/a080wf
http://prntscr.com/a081a9
http://prntscr.com/a082yk





Also thanks to all who helped in this matter.

-
- Posts: 419
- Joined: Wed, 11. Dec 13, 02:39
-
- Posts: 1896
- Joined: Fri, 18. Jul 14, 05:28
Such a variant is possible?Clownmug wrote:Yes, it should work with other entitytypes. For the tag though it depends on whether or not there's a character definition for the chosen faction.
Code: Select all
<select faction="faction.random" tags="tag.commander"/>
Code: Select all
faction.random
-
- Posts: 419
- Joined: Wed, 11. Dec 13, 02:39
No, but you could do something like this:alexalsp wrote:Such a variant is possible?Clownmug wrote:Yes, it should work with other entitytypes. For the tag though it depends on whether or not there's a character definition for the chosen faction.
Code: Select all
<select faction="faction.random" tags="tag.commander"/>
Code: Select all
faction.random
Code: Select all
<create_platform_actor name="$Actor" dockingbay="$DockingBay" type="entitytype.commander">
<owner exact="faction.player"/>
<select faction="[faction.plutarch,faction.heartofalbion,faction.argongovernment].random" tags="tag.commander"/>
</create_platform_actor>
Code: Select all
<set_value name="$Factions" exact="[faction.plutarch,faction.heartofalbion,faction.argongovernment]"/>
<create_platform_actor name="$Actor" dockingbay="$DockingBay" type="entitytype.commander">
<owner exact="faction.player"/>
<select faction="$Factions.random" tags="tag.commander"/>
</create_platform_actor>
-
- Posts: 1896
- Joined: Fri, 18. Jul 14, 05:28
Ok. Thank you.
I noticed, if use
NPC generated different supplies.
The captain may be: NPC trader and etc. but have the status - Captain. ))
I will try your code.

I noticed, if use
Code: Select all
select faction="faction.random"
The captain may be: NPC trader and etc. but have the status - Captain. ))
I will try your code.
