Freelancer Community Network
Reminder: Internet Explorer 6 or below are NOT supported.
HomeHome
ForumForum
WikiWiki
DownloadsDownloads
ForgeForge
Multiplayer Connection Tutorial
Collapse/Expand Random Image
Collapse/Expand Login
Username:

Password:

Remember me



Lost Password?

Register now!
Collapse/Expand Chat
Collapse/Expand Who's Online
33 user(s) are online (18 user(s) are browsing Forum)

Members: 0
Guests: 33

more...
Collapse/Expand Donations
Monthly costs: -30€
Income (ads): +5€
Donations (last month): +5€

Current balance: -60€
(last updated 10/2020)

Please make a donation if you want to help keeping The-Starport online:

Thanks!
Collapse/Expand Links
Collapse/Expand Advertisement
There are currently 30 users playing Freelancer on 42 servers.
October. 25, 2020

Browsing this Thread:   1 Anonymous Users



 Bottom   Previous Topic   Next Topic  Register To Post

(1) 2 »


FLMM v1.44 help needed - re: numTimes usage
Home away from home
Joined:
2008/5/21 19:32
Group:
Registered Users
FLServer Admins
$$$ Supporters $$$
Senior Members
Posts: 931
Offline
I'm having a problem with the way my script is activating the edits.

Here's the menu option. It's the first of the options in the menu and is defaulted to be option 1 (1:0 = don't activate, 1:1 = activate)

<options default="1:0">
<option name="Will You Be Flying CapShips?" savesafe="true">
<item id="0" name="No">
</item>
<item id="1" name="Yes">
</item>
</option>

The first section is supposed to activate regardless of which option is checked, the second is supposed to activate only if the second option is selected.

What happens in reality however is they both activate ALWAYS on select of option 1 (1:0) but NEITHER activates when option 2 (1:1) is selected.

<data file="data\equipment\market_misc.ini" method="append" numTimes="-1" options ="1:0, 1:1">
<section>
[BaseGood]
</section>
<source>
MarketGood = missile01_mark01_rtc_ammo, 1, -1, 1, 1, 0, 1, 1
MarketGood = nomad_gun01_mark01, 6, -1, 0, 0, 0, 0.00744
</source>
</data>

<data file="data\equipment\market_misc.ini" method="append" numTimes="-1" options ="1:1">
<section>
[BaseGood]
</section>
<source>
MarketGood = li_battleship_flak_turret01, 0, -1, 10, 10, 0, 1
MarketGood = li_battleship_turret02, 0, -1, 10, 10, 0, 1
MarketGood = br_battleship_flak_turret01, 0, -1, 10, 10, 0, 1
MarketGood = br_battleship_turret03, 0, -1, 10, 10, 0, 1
MarketGood = ku_battleship_flak_turret01, 0, -1, 10, 10, 0, 1
MarketGood = ku_battleship_turret04, 0, -1, 10, 10, 0, 1
MarketGood = rh_battleship_flak_turret01, 0, -1, 10, 10, 0, 1
MarketGood = rh_battleship_turret03, 0, -1, 10, 10, 0, 1
</source>
</data>

Any ideas why? Did I not code the instructions properly?

Posted on: 2012/11/26 0:01
Gun control is like fighting drunk driving by making it harder for sober people to buy a car...
Top
Re: FLMM v1.44 help needed - re: numTimes usage
Home away from home
Joined:
2008/5/21 19:32
Group:
Registered Users
FLServer Admins
$$$ Supporters $$$
Senior Members
Posts: 931
Offline
Oh, and before anyone slaps me on this, it seems to work the same whether or not I use method = append or method = sectionappend.

Also if I change the order of the switches from

<data file="data\equipment\market_misc.ini" method="append" numTimes="-1" options ="1:0, 1:1">

to

<data file="data\equipment\market_misc.ini" method="sectionappend" options ="1:0, 1:1" numTimes="-1">

that doesn't help either.

Posted on: 2012/11/26 0:05
Gun control is like fighting drunk driving by making it harder for sober people to buy a car...
Top
Re: FLMM v1.44 help needed - re: numTimes usage
Just can't stay away
Joined:
2008/5/25 23:28
Group:
Registered Users
Posts: 203
Offline
Where does it state that you can declare multiple option numbers in a single options declaration? I.e; where you put in the comma's?

Would it not be relevant here to just do:

<data file="data\equipment\market_misc.ini" method="append" numTimes="-1" options ="1:0">
<section>
[BaseGood]
</section>
<source>
MarketGood = missile01_mark01_rtc_ammo, 1, -1, 1, 1, 0, 1, 1
MarketGood = nomad_gun01_mark01, 6, -1, 0, 0, 0, 0.00744
</source>
</data>

<data file="data\equipment\market_misc.ini" method="append" numTimes="-1" options ="1:1">
<section>
[BaseGood]
</section>
<source>
MarketGood = missile01_mark01_rtc_ammo, 1, -1, 1, 1, 0, 1, 1
MarketGood = nomad_gun01_mark01, 6, -1, 0, 0, 0, 0.00744
MarketGood = li_battleship_flak_turret01, 0, -1, 10, 10, 0, 1
MarketGood = li_battleship_turret02, 0, -1, 10, 10, 0, 1
MarketGood = br_battleship_flak_turret01, 0, -1, 10, 10, 0, 1
MarketGood = br_battleship_turret03, 0, -1, 10, 10, 0, 1
MarketGood = ku_battleship_flak_turret01, 0, -1, 10, 10, 0, 1
MarketGood = ku_battleship_turret04, 0, -1, 10, 10, 0, 1
MarketGood = rh_battleship_flak_turret01, 0, -1, 10, 10, 0, 1
MarketGood = rh_battleship_turret03, 0, -1, 10, 10, 0, 1
</source>
</data>

???

Posted on: 2012/11/26 0:26
Top
Re: FLMM v1.44 help needed - re: numTimes usage
Home away from home
Joined:
2008/5/21 19:32
Group:
Registered Users
FLServer Admins
$$$ Supporters $$$
Senior Members
Posts: 931
Offline
The options section at the top identifies which option there is and which choices you can make within that option. If there were more options they would automatically be identified with consecutive numbers.

You can have as many choices within an option as you like, the user can select only one of them.

So, by choosing 1:0 the section identified in the data tag as being 1:0 would be activated. By choosing 1:1 the section identified in the data tag as being 1:1 would be activated. If the data line is identified with a 1:0, 1:1, 1:2, ... etc. that section would be activated if any of those choices were true.

If you look at the disco mod script you can see that one of the options is the type uniform Trent will wear. That option has 39 choices.

Having multiple choices in a script is not new. What's the problem for me in this case is that in this instance the command is not activated correctly either way. If I choose 1:0 BOTH choices are activated, if I choose 1:1 neither choice is activated.


Posted on: 2012/11/26 0:43
Gun control is like fighting drunk driving by making it harder for sober people to buy a car...
Top
Re: FLMM v1.44 help needed - re: numTimes usage
Home away from home
Joined:
2008/5/21 19:32
Group:
Registered Users
FLServer Admins
$$$ Supporters $$$
Senior Members
Posts: 931
Offline
Oh, I see what you're saying. Yeah, I tried that too but option 1:1 for some reason NEVER gets applied when numTimes is being used.

Posted on: 2012/11/26 0:51
Gun control is like fighting drunk driving by making it harder for sober people to buy a car...
Top
Re: FLMM v1.44 help needed - re: numTimes usage
Just can't stay away
Joined:
2008/5/25 23:28
Group:
Registered Users
Posts: 203
Offline
Been a long time since I've scripted with FLMM, but maybe if you aren't modifying this file in other areas of the script with choices - do this instead.

Do a file with the complete edits, so option 1 and 2 included and use copy file to place it. Then all you need to do is one sectionmodify with numtimes to comment out the option 2 stuff.

Am I making sense here? lol

Posted on: 2012/11/26 1:40
Top
Re: FLMM v1.44 help needed - re: numTimes usage
Just can't stay away
Joined:
2010/8/2 0:04
Group:
Registered Users
FLServer Admins
Posts: 464
Offline
options ="1:0,_1:1"
delete space after comma!
options ="1:0,1:1"

Posted on: 2012/11/26 7:28
Of all things that are lost - brain I miss most
Top
Re: FLMM v1.44 help needed - re: numTimes usage
Home away from home
Joined:
2008/5/21 19:32
Group:
Registered Users
FLServer Admins
$$$ Supporters $$$
Senior Members
Posts: 931
Offline
I tried that even though I suspected that wasn't the answer. And I was right. Having the space there has never been an issue before.
It's starting to look as if you can have numTimes or options, but not both. I wonder if there's a limit to the number of switches you can apply.

Posted on: 2012/11/26 13:33
Gun control is like fighting drunk driving by making it harder for sober people to buy a car...
Top
Re: FLMM v1.44 help needed - re: numTimes usage
Home away from home
Joined:
2008/5/21 19:32
Group:
Registered Users
FLServer Admins
$$$ Supporters $$$
Senior Members
Posts: 931
Offline
@Zyos
So, you're saying to apply both parts to all sections and then if option 1:0 is selected to delete the appropriate section? Seems clunky but it just might work...

Posted on: 2012/11/26 13:35
Gun control is like fighting drunk driving by making it harder for sober people to buy a car...
Top
Re: FLMM v1.44 help needed - re: numTimes usage
Home away from home
Joined:
2008/5/21 19:32
Group:
Registered Users
FLServer Admins
$$$ Supporters $$$
Senior Members
Posts: 931
Offline
Quote:

Zyos wrote:
Been a long time since I've scripted with FLMM, but maybe if you aren't modifying this file in other areas of the script with choices - do this instead.

Do a file with the complete edits, so option 1 and 2 included and use copy file to place it. Then all you need to do is one sectionmodify with numtimes to comment out the option 2 stuff.

Am I making sense here? lol


Yes...
except as I'm looking at it further, that would require combining numTimes with options= and we're back where we started. In other words, how do we tell the script WHEN to comment out the option 2 stuff? We'd need to use options="1:0" again. And that doesn't work.

Just out of curiosity though, sectionmodify to comment something out? I thought sectionmodify looked at the existing key and compared the <source> value to see if they're the same and then applied any changes. ie. if the key is radius = 1000 and you want to section modify it to 1500 you'd have radius = 1500 in your <source> section.

So, how does it work when it's trying to compare a radius = key to a <source> value of ;radius =. Won't it just append the commented keys to the existing section and really change nothing?

Although, I suppose it could be radius = ;<value> instead of ;radius = <value>

(off to check it out)


Posted on: 2012/11/26 14:08
Gun control is like fighting drunk driving by making it harder for sober people to buy a car...
Top
Re: FLMM v1.44 help needed - re: numTimes usage
Home away from home
Joined:
2008/5/21 19:32
Group:
Registered Users
FLServer Admins
$$$ Supporters $$$
Senior Members
Posts: 931
Offline
Out of curiosity again...
I tried using numInstances again.

<data file="data\equipment\market_misc.ini" method="sectionappend" numTimes="-1">
<section>
[BaseGood]
</section>
<source>
MarketGood = missile01_mark01_rtc_ammo, 1, -1, 1, 1, 0, 1, 1
MarketGood = nomad_gun01_mark01, 6, -1, 0, 0, 0, 0.00744
</source>
</data>

<data file="data\equipment\market_misc.ini" method="sectionappend" options ="1:1">
<section numInstances ="-1">
[BaseGood]
</section>
<source>
MarketGood = li_battleship_flak_turret01, 0, -1, 10, 10, 0, 1
MarketGood = li_battleship_turret02, 0, -1, 10, 10, 0, 1
MarketGood = br_battleship_flak_turret01, 0, -1, 10, 10, 0, 1
MarketGood = br_battleship_turret03, 0, -1, 10, 10, 0, 1
MarketGood = ku_battleship_flak_turret01, 0, -1, 10, 10, 0, 1
MarketGood = ku_battleship_turret04, 0, -1, 10, 10, 0, 1
MarketGood = rh_battleship_flak_turret01, 0, -1, 10, 10, 0, 1
MarketGood = rh_battleship_turret03, 0, -1, 10, 10, 0, 1
</source>
</data>

Both sections were added even when the choice was 1:0, not 1:1. But, only to the first section in the file. The first section was added to all other sections but not the second.

If 1:1 is selected the first section is not applied.
edit: fixed this little problem by changing the options defaults at the beginning of the script. But, the option is only applied to the first [Section] in the file.

Still looking for a solution

Posted on: 2012/11/26 14:18
Gun control is like fighting drunk driving by making it harder for sober people to buy a car...
Top
Re: FLMM v1.44 help needed - re: numTimes usage
Home away from home
Joined:
2008/5/21 19:32
Group:
Registered Users
FLServer Admins
$$$ Supporters $$$
Senior Members
Posts: 931
Offline
numInstances is not an option in this case. The value for numInstances must be greater than "1" and will not apply for this edit.

Configured as displayed above it does only the first section in the file.

Configuring it thusly:
<data file="data\equipment\market_misc.ini" method="sectionappend" options ="1:1">
<section>
[BaseGood]
</section>
<section numInstances ="-1">
[BaseGood]
</section>
<source>
MarketGood = li_battleship_flak_turret01, 0, -1, 10, 10, 0, 1
MarketGood = li_battleship_turret02, 0, -1, 10, 10, 0, 1
MarketGood = br_battleship_flak_turret01, 0, -1, 10, 10, 0, 1
MarketGood = br_battleship_turret03, 0, -1, 10, 10, 0, 1
MarketGood = ku_battleship_flak_turret01, 0, -1, 10, 10, 0, 1
MarketGood = ku_battleship_turret04, 0, -1, 10, 10, 0, 1
MarketGood = rh_battleship_flak_turret01, 0, -1, 10, 10, 0, 1
MarketGood = rh_battleship_turret03, 0, -1, 10, 10, 0, 1
</source>
</data>

gives an error stating that numInstances must be greater than "1".

So, perhaps the easy way doesn't work for this scenario.
I'll likely have to use numTimes to apply the first section and then use "sectionappend" to enter the second section individually to each [BaseGood] section. What a hassle... I was hoping to configure it to be added automatically any time a new [BaseGood] section was added to the mod.

Posted on: 2012/11/26 14:47
Gun control is like fighting drunk driving by making it harder for sober people to buy a car...
Top
Re: FLMM v1.44 help needed - re: numTimes usage
Home away from home
Joined:
2008/5/21 19:32
Group:
Registered Users
FLServer Admins
$$$ Supporters $$$
Senior Members
Posts: 931
Offline
Can someone check this for me?
I can't get this to work right no matter what I do.

Dependencies include FLMM 1.4b4 and JFLP 1.0

<script>
<header name="Test Mod" savesafe="true">
<scriptversion>
1.4
</scriptversion>
<author>
Compiled by: The FLU Modding Team
</author>
<description>
Dependencies:
- Freelancer Mod Manager v 1.4 beta4
- Adoxa's JFLP freelancer Update version 1.0
</description>

<options default="1:0,1:1">
<option id="1" name="Activate Mod?" savesafe="true">
<item id="0" name="No">
</item>
<item id="1" name="Yes">
</item>
</option>
</options>
</header>

<data file="DATA\EQUIPMENT\market_misc.ini" method="sectionappend" numTimes="-1">
<section>
[BaseGood]
</section>
<source>
MarketGood = missile01_mark01_rtc_ammo, 1, -1, 1, 1, 0, 1, 1
MarketGood = nomad_gun01_mark01, 6, -1, 0, 0, 0, 0.00744
</source>
</data>

<data file="data\equipment\market_misc.ini" method="sectionappend" numTimes="-1" options="1:1">
<section>
[BaseGood]
</section>
<source>
MarketGood = li_battleship_flak_turret01, 0, -1, 10, 10, 0, 1
MarketGood = li_battleship_turret02, 0, -1, 10, 10, 0, 1
MarketGood = br_battleship_flak_turret01, 0, -1, 10, 10, 0, 1
MarketGood = br_battleship_turret03, 0, -1, 10, 10, 0, 1
MarketGood = ku_battleship_flak_turret01, 0, -1, 10, 10, 0, 1
MarketGood = ku_battleship_turret04, 0, -1, 10, 10, 0, 1
MarketGood = rh_battleship_flak_turret01, 0, -1, 10, 10, 0, 1
MarketGood = rh_battleship_turret03, 0, -1, 10, 10, 0, 1
</source>
</data>

<data file="DATA\EQUIPMENT\market_misc.ini" method="sectionreplace">
<section>
[BaseGood]
base = Br03_02_base
</section>
<dest>
MarketGood = nomad_gun01_mark01, 6, -1, 0, 0, 0, 0.00744
</dest>
<source>
MarketGood = nomad_gun01_mark01, 6, -1, 0, 0, 0, 3
</source>
</data>
</script>

When selecting option "Yes" it seems to work fine, but when selecting option "No" it gives the error that the lines it's looking for can't be found.

Commenting out (or removing) the last change confirms that the first two instructions are working properly.

Any help appreciated.

R

Posted on: 2012/12/5 23:52
Gun control is like fighting drunk driving by making it harder for sober people to buy a car...
Top
Re: FLMM v1.44 help needed - re: numTimes usage
Home away from home
Joined:
2009/8/16 2:58
From Qld, Aus.
Group:
Registered Users
FLServer Admins
Trusted Speciality Developers
Senior Members
Posts: 1958
Offline
Works fine with v2.

Posted on: 2012/12/6 4:42
Top
Re: FLMM v1.44 help needed - re: numTimes usage
Home away from home
Joined:
2008/5/21 19:32
Group:
Registered Users
FLServer Admins
$$$ Supporters $$$
Senior Members
Posts: 931
Offline
Ahh, the mighty Adoxa.
Thanks for responding.

v2 is great, but there are a couple of issues with writing the mod for v2.

1). It would require every user to switch to v2 and by your own admission, a number of mods out there aren't compatible with v2, so it would require a choice on the user's part as to which FLMM they're going to use in order to run a mod.

2). In order to take full advantage of v2's features I'd have to completely rewrite our mod and I have neither the ken of scripting I would need, nor the time to learn. I looked at it a couple of times about the time you went on hiatus and couldn't figure out just what was being done. A couple attempts I made to convert didn't work out well and I gave it up.

At any rate, the choice is to rewrite the mod to make it compatible with v2 and potentially lose playerbase when they have to switch FLMMs, or to leave it as is.

If there's another choice I'd sure like to know what it is.

Posted on: 2012/12/6 11:16
Gun control is like fighting drunk driving by making it harder for sober people to buy a car...
Top
(1) 2 »