• Welcome to Battlezone Universe.
 

News:

Welcome to the BZU Archive dated December 24, 2009. Topics and posts are in read-only mode. Those with accounts will be able to login and browse anything the account had access granted to at the time. No changes to permissions will be made to be given access to particular content. If you have any questions, please reach out to squirrelof09/Rapazzini.

Main Menu

DLL & AUTOREG trickery

Started by TheJamsh, January 28, 2009, 03:47:47 PM

Previous topic - Next topic

TheJamsh

Im no programmer outside of the PIC chip programmer and the BZII dll scriptor. But i have a question

I want recycler variants to become available in my mod when you pass certain missions. The most effective way i think this can be done is to 'write' an AUTOREG file in the rootdir when certain parts of the mission/storyline are passed. Hell you could have plenty of fun with it.

I suspect it's do-able, albeit far outside the scope of the BZII scriptor. My question is, can it be done? and if so (to a programming noob), how?


BZII Expansion Pack Development Leader. Coming Soon.

Nielk1

Easily. Interesting Idea. Another option is to yell at a person who uses a rec they can't. Yes, you can load such things, but it would be the server with all the control of the MP game, and someone could bypass it rather easily.

Click on the image...

GSH

Writing out files to C:\Program Files\Games\Battlezone II\ (or anything under program files) is going to fail, miserably, under Vista or Win7 when not run as an admin. Please don't go that route.

A very similar issue came up a few weeks ago, with another modder. (Some work does get done on irc, even if nobody else uses it.) Writing an access key to the registry (under HKEY_CURRENT_USER\...) is a way that'll work on all systems; the DLL just needs to check the access, and early-exit if the user's using the wrong thing. I put up a really small sample in the area for private testers.

-- GSH

Nielk1

So we go for the 2nd option, yell at the user... :-P

Click on the image...

TheJamsh

aww =[

i wanted certain recs to 'unlock' when missions were passed.

maybe a 'use after mission no = ##' entry in autoreg files =] =] =] =]


BZII Expansion Pack Development Leader. Coming Soon.

GSH

Autoreg are used by IA/MPI. There is not concept of mission progression in bzone.exe for IA/MPI.

-- GSH

TheJamsh

yeh its a shame but im sure i can work around it. if a .dll can write an autoreg file (a mission .dll BTW) then the idea can be pulled off.


BZII Expansion Pack Development Leader. Coming Soon.

Red Devil

TJ, just make custom maps like in SP and place your variant recyclers on them and set missions.odf to point to the maps.  That's what stock SP does.
What box???

GSH

Quote
yeh its a shame but im sure i can work around it. if a .dll can write an autoreg file (a mission .dll BTW) then the idea can be pulled off.

Already said so earlier this thread: that idea is full of FAIL on Vista/Win7 if BZ2 is under C:\Program Files\ . DLLs can write to the *registry* very easily, and insta-fail the mission if they don't like the access level and the chosen recy.  At that point, you're better off just manually spawning the user's recy and ignoring the chosen item.

-- GSH

TheJamsh

the idea is that the recy variants become available for IA & MPI when you unlock new technology in the campaign... i dont really like people being able to jump straight in. might be a bit much.

custom maps of course... could work in the same way with a custom .dll removing the 'spawn recycler' part of the code...


BZII Expansion Pack Development Leader. Coming Soon.

Red Devil

Hmmm....

I'm thinking that the dll could write out/modify a map's .inf file on the server with its varbs set depending on the outcome, but, as GSH says, where it writes it to would be problematic.
What box???

bigbadbogie

What about cfgs?

Can the dll write to those files? Because I know it can read them.
Others would merely say it was good humour.


My BZ2 mods:

QF2: Essence to a Thief - Development is underway.

Fleshstorm 2: The Harvest - Released on the 6th of November 2009. Got to www.bz2md.com for details.

QF Mod - My first mod, finished over a year ago. It can be found on BZ2MD.com

Nielk1

Yes the DLL can write files.

No, it is not good for Vista.

Click on the image...

TheJamsh

unless you run in Admin mode...

great. fahkin vista screring stuff up as usual


BZII Expansion Pack Development Leader. Coming Soon.

GSH

Stop thinking you can write files to C:\Program Files! You've lost this battle when MS decided that user's files do not belong there. I agree with them -- on all my unix boxes, I don't have write access to /usr/bin when running as me.

Instead, start thinking about all of the options I've already mentioned (hint, hint, REGISTRY) this thread. See http://msdn.microsoft.com/en-us/library/bb756940.aspx for MS's recommended places to read and write things. As it says, ${MyDocs}/My Games/Battlezone II is possible, but you MUST not hardcode that path, but use http://msdn.microsoft.com/en-us/library/bb762188(VS.85).aspx to query its path.

-- GSH