Page 85 of 127

Re: Questions here: an inquiry thread! [Updated Sep 15th, 2014]

Posted: Tue Nov 03, 2015 8:57 pm
by meklozz
Yes, I think it should be possible to incorporate USB into your (and anyone's, without conflicts) mods as long as everyone's events are made in a way that supports event chaining of game_beacon and eventually lands at game_choices.

If you want it to work well with USB, you probably shouldn't change start_game text either, but rather start off with the normal text and then add yours in your event. That's mostly cosmetic stuff though.

Re: Questions here: an inquiry thread! [Updated Sep 15th, 2014]

Posted: Tue Nov 03, 2015 9:33 pm
by kartoFlane
Just a note: incorporating USB's code into your own mod breaks the entire framework, preventing other mods that depend on it from working (unless you load them after your own mod, in that case it should be fine)

Re: Questions here: an inquiry thread! [Updated Sep 15th, 2014]

Posted: Tue Nov 03, 2015 10:03 pm
by meklozz
kartoFlane wrote:Just a note: incorporating USB's code into your own mod breaks the entire framework, preventing other mods that depend on it from working (unless you load them after your own mod, in that case it should be fine)
Did you see the part that removes any instance of USB but the first? I looked at the original thread a while ago and figured this should work.

Code: Select all

<mod:findName type="event" name="START_GAME_EVENT" reverse="false" start="1">
   <mod:removeTag/>
</mod:findName>
<mod:findName type="event" name="START_GAME_BEACON" reverse="false" start="1">
   <mod:removeTag/>
</mod:findName>
<mod:findName type="event" name="START_GAME_CHOICES" reverse="false" start="1">
   <mod:removeTag/>
</mod:findName>

Re: Questions here: an inquiry thread! [Updated Sep 15th, 2014]

Posted: Tue Nov 03, 2015 10:39 pm
by kartoFlane
Huh. Yeah, it should work, though given that SMM tags are processed in a sequential fashion from top to bottom (IIRC), these should be placed at the top of the events file (so that we remove the duplicates before appending choices to them).
Also, I think there might be some trouble with removing the START_GAME_BEACON, seeing as mods are encouraged to rename the previously found event with that name and chain-load it... though based on a quick examination on a scrap piece of paper, it seems this should work just fine.

Re: Questions here: an inquiry thread! [Updated Sep 15th, 2014]

Posted: Tue Nov 03, 2015 10:53 pm
by meklozz
Yes, that's what I thought, it should be after the new USB framework (so there's something for it to get rid of), but before the changes a mod makes. Otherwise the new GAME_BEACON will be put at the bottom and get deleted instead.
I also put USB framework twice in the code a couple posts above, because older slipstream had a bug where it would ignore start tag if there weren't at least as many instances as start suggested. They exist to get deleted anyway.

Re: Questions here: an inquiry thread! [Updated Sep 15th, 2014]

Posted: Wed Nov 04, 2015 11:48 am
by Biohazard063
Continued messing around a bit more. Turns out the removal of the civilian sectors was necessary since going to one will once again allow you to pick the option you got at the start of the game.
meklozz wrote:I really hope I'm not just confusing you more. Really sorry if I am.
As for confusing me. Yes, you have (just read the entire post as I was occupied with something else the first time I replied on it). But by all means, don't feel bad about. Heck, I don't even understand what chain-loading events mean. Though I probably would if someone told me what it was.
Also, why is the requirement set to engines? Does it need to be a blue option that is always fulfilled? The ship I'm using this on starts with a scrap arm.
In any case, what I want is to incorporate USB into my mod so people don't have to download USB separately. Keeping things easier for the player and all that. But credit will be given to kartoflane for the USB and at this point you're going on the list as well. :D

So this :

Code: Select all

<mod:findName type="event" name="START_BEACON">
  <mod-append:choice hidden="true" req="SCRAP_COLLECTOR">
    <text>Open the encrypted file</text>
		<event load="INITIAL_START_BEACON_SCRAPPER"/>
  </mod-append:choice>
</mod:findName>

<mod:findName type="event" name="START_GAME_BEACON">
  <mod-append:choice hidden="true" req="SCRAP_COLLECTOR">
    <text>Open the encrypted file</text>
    <event load="INITIAL_START_BEACON_SCRAPPER"/>
  </mod-append:choice>
</mod:findName>

<event name="START_GAME">
	<text>You are a scrap ship constructed by the rebels and designed to recover usable parts from decomissioned ships or those destroyed in battle and scrap whatever is beyond salvaging. You're next objective has just come in.</text>
</event>

<event name="INITIAL_START_BEACON_SCRAPPER">
	<text>"Scrapper S-158B : Proceed to the designated beacon. Carry out protocol A-1 : Scan, recouperate, scrap, deliver. Additional information : Area location of recent rebel-lanius skirmish. Size : minor. Hazard : None. End of message. </text>
	<choice hidden="true">
		<text>Continue...</text>
		<event>
			<text>"Response recieved, awaiting completion of order."</text>
			<quest event="SCRAP_BEACON" />	
		</event>		
	</choice>
</event>
Needs to become what if I want to keep the text I'm getting the way it is now whilst making it compatible with say CE ? (Not looking into making it compatible with other ship mods as that would break the story I'm setting up with this ship anyway.)
As in at the start of the game the first box reads what's under "START_GAME" with the options : Open the encrypted file, followed by what is written under INITIAL_START_BEACON_SCRAPPER

And I'm guessing the sector_data :

Code: Select all

<mod:findName type="sectorType" name="CIVILIAN">
		 <mod:findLike type="sector">
			<mod:selector>CIVILIAN_SECTOR</mod:selector>
			<mod:removeTag />
		</mod:findLike>
</mod:findName>
Needs to become something like this :

Code: Select all

<mod:findName type="sectorDescription" name="CIVILIAN_SECTOR">
	<mod-overwrite:startEvent>MOD_START_BEACON_CIVILIAN</mod-overwrite:startEvent>
</mod:findName>
Now, the thing is, the code I found for sector_data comes from the auto-terminator mod from RAD-82. The thing is, when I look in the event files for that mod, there is no event called MOD_START_BEACON_CIVILIAN

All this just to get an interesting start. People better appreciate it ! :lol:

Re: Questions here: an inquiry thread! [Updated Sep 15th, 2014]

Posted: Wed Nov 04, 2015 1:47 pm
by meklozz
From the start:

I know about civilian sector getting the same event as the starting one, that's why USB adds this to sector data:

Code: Select all

<!-- This sets the framework in motion. Don't change this. -->
<mod:findName type="sectorDescription" name="STANDARD_SPACE">
    <mod-overwrite:startEvent>START_GAME_EVENT</mod-overwrite:startEvent>
</mod:findName>
That way, you're actually changing the starting event, not the ones in the civilian sector. If you change the civilian sector ones, then you'd have to add those as well, and I'm not entirely sure it would work, because, even now, the civilian sector's starting event doesn't appear to load the same event as the first sector, but it does.

Engines are there because I couldn't be bothered to create an augment for testing and putting it on the ship, don't mind them.

For chain-loading, read carefully through the USB thread. If you want to include it in your mod, you should try and figure it out, took me a few minutes the first time around, too. Basically, any time a mod with USB support is added, it renames START_GAME_BEACON to something else, like BIOH_START_GAME_BEACON, then creates a new START_GAME_BEACON and makes sure that it will end by loading BIOH_START_GAME_BEACON, ensuring everyone's events get loaded.

The end result is something like:

START_GAME_EVENT (with text from start_game) >> START_GAME_BEACON >> MEK_START_GAME_BEACON >> BIOH_START_GAME_BEACON >> START_GAME_CHOICES (mutually exclusive)

You might want to use game_choices, since it should only be activated if someone's actually flying the ship. Game_beacons get triggered on each start, although without the blue option, it wouldn't matter much.

As for the start_game text being what you want it, that's kind of opposite of the point of USB, since you're butting in with your lore before anyone else's. For compatibility with USB, you'd probably want that text after you make the check for Scrap Recovery Arm, so the game knows you're flying the right ship. I mean, do what you will, but if you only want compatibility with CE, USB is not really necessary.

In fact, CE doesn't seem to actually support USB at all. All you need to do is make the standard sector spawn another event, like USB does, but with your own name, and then create that event that will do what you want, change start_game text (as you already did), and try and make you event end with loading START_BEACON, so you get all the CE stuff like peeking at the random flagship and crafting and talking to crew.

Hope you figure it out, kind of want to play the actual ship at this point :D

Re: Questions here: an inquiry thread! [Updated Sep 15th, 2014]

Posted: Wed Nov 04, 2015 3:52 pm
by Biohazard063
meklozz wrote:Snip
I do remember CE not supporting USB, so all things considered, we are getting really close.
As far as not getting CE's standard options, we're fine on that as well I believe. If I don't really care about compatibility with other ship mods.
There is no crew to talk to at the start and the only option as far as fabricating on board goes would be another scrap arm, which you don't have the scrap for at the start anyway.
So basically, it boils down to finding a way to not have to remove the other civilian sectors. Which I'm guessing is where that sector_data code comes into play.
I'll get that figured out (which hopefully doesn't take too long as testing will require me to find another civilian sector). Other than that, the ship is ready to go...

Thanks for the help (again).

Re: Questions here: an inquiry thread! [Updated Sep 15th, 2014]

Posted: Wed Nov 04, 2015 4:18 pm
by RAD-82
Biohazard063 wrote:Now, the thing is, the code I found for sector_data comes from the auto-terminator mod from RAD-82. The thing is, when I look in the event files for that mod, there is no event called MOD_START_BEACON_CIVILIAN
My Auto-Terminator code that you are trying to use:

Code: Select all

sector_data.xml.append

<mod:findName type="sectorDescription" name="CIVILIAN_SECTOR">
	<mod-overwrite:startEvent>AT_START_BEACON_CIVILIAN</mod-overwrite:startEvent>
</mod:findName>

events.xml.append

<mod:findName type="event" name="START_BEACON">
	<mod:setAttributes name="AT_START_BEACON_CIVILIAN" />
</mod:findName>

<event name="START_BEACON">
	<text>(Auto-Terminator) Accessing DNA data...</text>
	<choice req="ANY_CREW" lvl="0" max_lvl="0" blue="false">
		<text>Clone Hunter...</text>
		<event>
			<text>Hunter is ready for battle!</text>
			<crewMember amount="1" class="human" all_skills="2">Hunter</crewMember>
			<choice hidden="true">
				<text>Continue...</text>
				<event load="AT_START_BEACON_CIVILIAN" />
			</choice>
		</event>
	</choice>
	<choice hidden="true">
		<text>Continue...</text>
		<event load="AT_START_BEACON_CIVILIAN" />
	</choice>
</event>

<mod:findName type="event" name="START_GAME_BEACON">
	<mod:setAttributes name="AUTOTERMINATOR_START_GAME_BEACON" />
</mod:findName>

<event name="START_GAME_BEACON">
	<text>(Auto-Terminator) Accessing DNA data...</text>
	<choice req="ANY_CREW" lvl="0" max_lvl="0" blue="false">
		<text>Clone Hunter...</text>
		<event>
			<text>Hunter is ready for battle!</text>
			<crewMember amount="1" class="human" all_skills="2">Hunter</crewMember>
			<choice hidden="true">
				<text>Continue...</text>
				<event load="AUTOTERMINATOR_START_GAME_BEACON" />
			</choice>
		</event>
	</choice>
	<choice hidden="true">
		<text>Continue...</text>
		<event load="AUTOTERMINATOR_START_GAME_BEACON" />
	</choice>
</event>
The sector_data code adds a new startEvent to the civilian sector, so that it won't use START_BEACON. Then in events, I find the START_BEACON code and rename it to the new civilian startEvent that I just added. Next I added the new START_BEACON which will no longer be called at the start of civilian sectors, but is still used at the start of the game.

The last two bits of code with the START_GAME_BEACON are for USB compatibility, because there is the Infinite Space mod which I put the USB into when I updated it for AE. It is just the basic USB chain-loading code.
I'll get that figured out (which hopefully doesn't take too long as testing will require me to find another civilian sector).
I will point out that CE has custom civilian sectors to avoid this start beacon nonsense, so you have to test it without CE.

Re: Questions here: an inquiry thread! [Updated Sep 15th, 2014]

Posted: Wed Nov 04, 2015 4:54 pm
by meklozz
That looks great, you should go with that. I think you can still add USB to that if you add the lines at the beginning of each file.