What's new
  • Visit Rebornbuddy
  • Visit Panda Profiles
  • Visit LLamamMagic
  • Visit Resources
  • Visit Downloads
  • Visit Portal

Trinity XMLTag "TrinityLoadOnce" enhancement

Awe

New Member
Joined
Dec 20, 2012
Messages
21
Reaction score
0
Just a quick update for the Trinity XML tag "TrinityLoadOnce" for Trinity 1.7.2.6

With this mod Trinity can select from several iterations of the same randomly chosen profile, similar to the ATOM plugin.
Simply separate the similar profiles with a semi-colon ";". There isn't a restriction to the amount of similar profiles to add (i think... ;)).
Backwards compatible with your existing profiles already using the TrinityLoadOnce XML tag too.

Example code:
Code:
<TrinityLoadOnce questId="1" stepId="1" >
	<ProfileList>
		<LoadProfileOnce profile="StonefortA.xml;StonefortB.xml" /> 
		<LoadProfileOnce profile="SkycrownA.xml;SkycrownB.xml" />
		<LoadProfileOnce profile="DamnedTowerA.xml;DamnedTowerB.xml" />
		<LoadProfileOnce profile="CursedTowerA.xml;CursedTowerB.xml" />
	</ProfileList>
</TrinityLoadOnce>


Attached is the modded "TrinityLoadOnce.cs" source file you can copy into your /Plugins/GilesTrinity/XMLTags directory.
Also attached is a blank test profile to check the functionality.

Cheers!
 

Attachments

Thanks for sharing, is that your work or did you just want to inform us about it?
 
Sorry, yeah that's a change I've made which works with the latest Trinity.
 
Well then thanks to you, its a nice comfort function and saves a workaround with an extra profile ^^
Maybe post it in the trinity thread / pm rrrix so he can include it in future releases.
 
Merged into next build - thanks Awe, looks good!
 
Great, thanks rrrix.

Whilst on this subject, I've found a bug (or a feature..?) in the original "TrinityLoadOnce.cs" file with the randomization of the profiles - it will always select the last profile last.
This can be easily tested by loading only 2 profiles and it will always select the first profile first, followed by the second.

The culprit is in the following line:
Code:
new Action(ret => NextProfileName = AvailableProfiles[rand.Next(0, AvailableProfiles.Length - 1)]),

Remove the "- 1" to fix this problem:
Code:
new Action(ret => NextProfileName = AvailableProfiles[rand.Next(0, AvailableProfiles.Length)]),

Any chance you can merge this fix into the next build also?

Cheers!
 
Back
Top