OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: SilentHunter on 06 Mar 2005, 18:03:58
-
Im planning to populate a listbox with an array of addons, but it would be far easier if there was a set of commands that finds out what addons you've got
Question:
How can you make FP get a list off all the addons you've got in the addons folder?
I can work the rest out from there
SILENTHUNTER
-
You can't...
Unless I completely misunderstood your question... ::)
-
He wants to make a mission(?) that opens a dialog, and shows you all the addons you have installed in your flashpoint addons/ folder..
-
Bingo!
-
So I understood it correctly then... :P
And you can't do that (afaik)...
-
Hey!
I have to disagree. I think it is possible. Using a program such as flash, you could create 3 folders: Official Addons, Unofficial Addons and Wrong Format addons. This sounds like a great idea! Alls you'd need to do is to get the database to search your addons folder and sort the files out.
Scooter24.
-
Emmmm.......I think he wants to do this from within his mission, so I have to concur that it isn't really possible.
AFAIK there is no command that allows you to run external programs or files from within the game.
Planck
-
*Reaches for frozen leg of lamb*
-
He wants to make a mission(?) that opens a dialog, and shows you all the addons you have installed in your flashpoint addons/ folder..
The only thing U know is that all the required addons for this missions are in an addonfolder.
Otherwise U would get an error.
So,is there a way to get the info from mission.sqm (addOns[])?
This array must be stored somewhere,as it shows up in Flashpoint.rpt when OFP chrashes..
-
um... maybe you could do this is in a very long and tedious script using the "typeOf" command. get the script to identify every object in the mission which is an not original by checking it against everyone which you know is standard BIS unit. then you could use the typeOf command to create a sting with its type and then you could stick it in the listbox. it does assume that every addon available is on the map, though. :(
something like this:
_type=typeOf _unit
? !_type=BIS UNIT 1 AND !_type=BIS UNIT 2 OR ... (you get the idea):goto "DisplayAddonName"
exit
#DisplayNewAddonName
*command to update dialog with the variable '_type'*
and there's a very long way around it... unless ive got something wrong... in which case its not :-\
-
What if we edit some vital game system files to make the ENTIRE mission.sqm a public variable, (u 'ered, ENTIRE). It would work in the same way the game updates the time in hex and converts it to a sqs compatable command in the form of the variable _time (surprisingly)
What ya think?
-
What ya think?
It would be illegal...
You would need to distribute a 're-engineered' game file, and the 're-engineering' is already illegal, so...
Furthermore, how exactly you would utilise a 'public variable' of that lenght (in 'worst' cases hundreds (even thousands) of lines long..)??
You still could not search the variable with OFP functions and/or pick any part from it etc...
So it would not solve your 'problem' at all...
And, why it is so important to know what AddOns someone has?? If your mission or something would require hacking OFP game files then you need to seriously re-think your approach...
You could try a variation of bored_onion's idea, and list all the AddOns you know, camCreate or createVehicle them and check if there's something created, and if there is you would know which AddOn is used...
harsh example:
_veh = "somevehicle" camCreate [0,0,0]
? isNull _veh: thisAddOnInUse=false
-
I think what he wants to do is use a dialog that has a listbox, which will list all the addons that are in the addons folder on the machine it is running on.
He is looking for a way to interrogate the addons folder and get a list of the addons to put in the listbox.
I don't see a way to do it from within OFP.
Planck
-
@Hater_kint
@prospect of it being illegal,
what is this term "illegal" you speak off, (I jest (joke))
You could try a variation of bored_onion's idea, and list all the AddOns you know
Too easy
You still could not search the variable with OFP functions
(hmmmmm, the man raises a good point here, struggles to thing of defensive comeback) I suppose I would have to edit the game to do that aswell. In fact while im at it I might as well write a COMPLETELY new game, shouldn't take me too longâ€Â¦
And, why it is so important to know what AddOns someone has?? If your mission or something would require hacking OFP game files then you need to seriously re-think your approach...
In all my many years of flashpointing, across many boards on many servers I have never seen an idea met with such criticism by a single person. Why must you mock and I idea or principle you know little about? My motive and methods haven't even been revealed. I could do the coding in hex myself. (@ other hex crackers while im on the subject, flashpoint is written really poorly inside aint it, it's a miracle it works at all!)
For shame to all of you, FOR SHAME, *turns back on flashpoint, goes plays counter strike, gives in after 3 mins, goes back to flashpoint*
SILENTHUNTER
"Writes suicide note" : for shame
*hangs self*
-
In all my many years of flashpointing, across many boards on many servers I have never seen an idea met with such criticism by a single person.
Then you must not have been at BI Forums at all... Ever... ;D ::)
Why must you mock and I idea or principle you know little about? My motive and methods haven't even been revealed.
Well, why don't you reveal something about your motives then...
Because I just can't see why to go through all that 'trouble' just to get some addon list...
I'm not mocking anything, I'm just assuming (due to you not revealing much about your motives) that this again something that could be done much easier than hacking the game...
But I'm not stopping you...
I doubt that many would use something that alteres the original game though...
I think if this hacking discussion is continued any further this topic's getting locked quite soon....
-
gah,
it don't matter,
but it must be possible, like the ingame mission editor gets a list of all your addons
*tightens rope*
-
I've tried it, it was also my first idea to do this with typeof :)
I've created an object ingame that was not in my addons folder.
There were no critical errors during the creation (just a short slowdown) , but when I debug the named object with typeof, it returned nothing.
so...
_veh = "somevehicle" camCreate [0,0,0]
? isNull _veh: thisAddOnInUse=false
doesn't work.
-
The game engine reads all the addons at startup, presumable it reads and checks all the config.cpp's.
Where it then stores this list is anyones guess.
I would say it is stored in memory and I don't know any scripting commands that would allow access to it.
Planck
-
Careful guys...
What if we edit some vital game system files to make the ENTIRE mission.sqm a public variable, (u 'ered, ENTIRE). It would work in the same way the game updates the time in hex and converts it to a sqs compatable command in the form of the variable _time (surprisingly)
Attempting to modify the main EXE is indeed illegal without express permission from BI Studios.
Unless that is presented, any further discussion towards the "hacking" of the EXE will be locked.
Methodology/encouragement/discussion of "how to" are not permitted. At this stage, you've moved back to the 'safe' side of a very thin line. Be careful not to cross it again.
In all my many years of flashpointing, across many boards on many servers I have never seen an idea met with such criticism by a single person. Why must you mock and I idea or principle you know little about?
Discussion of this nature would have been shut down immediately at your previously quoted post, over at the official forums.
It isn't mocking the idea, it's protecting BI Studio's intellectual property, something the community as a whole takes seriously.
-
dudes, i dont think you understand, we come here for help answers, not to be told the idea is unworthy of positive advice,
@Noon416
modifying executables for personal use is by no means illegal, (im a teacher, old and wise) I would even think about distributing it, i love FP so much i bought it twice, (having said that, the administration team at codemasters/bi should all go hang (no offence)) developers on the other hand, genious
Admins, i recomend locking this subject now, drifting FAR away from the point
SILENTHUNTER (from beyond the gave)
(Im probly gonna get kicked 4 this, been a bad month, damn i need a social life, soz @ anyone i've annoyed)
-
Locked at the author's request.
*Locked*