Scripting - Finding and editing armor condition

Post » Wed Jan 20, 2010 5:54 pm

The Weapon Repair Kit uses 'player.getWeaponHealthPerc' and 'player.setWeaponHealthPerc' to get and set weapon condition. If someone was trying to create an Armor Repair Kit, are there equivalent functions for whatever is currently filling the 'upper body' slot? I've looked around the functions list on the GECK wiki, and can't see anything.

Thanks in advance
User avatar
Tiffany Holmes
 
Posts: 3351
Joined: Sun Sep 10, 2006 2:28 am

Post » Wed Jan 20, 2010 11:26 am

The Weapon Repair Kit uses 'player.getWeaponHealthPerc' and 'player.setWeaponHealthPerc' to get and set weapon condition. If someone was trying to create an Armor Repair Kit, are there equivalent functions for whatever is currently filling the 'upper body' slot? I've looked around the functions list on the GECK wiki, and can't see anything.

Thanks in advance


Nope not that I have seen?????

I hope someone proves me wrong. If it's there, I would like to avail myself of it eh....
User avatar
roxxii lenaghan
 
Posts: 3388
Joined: Wed Jul 05, 2006 11:53 am

Post » Wed Jan 20, 2010 7:07 am

Armour Repair Kits
http://www.newvegasnexus.com/downloads/file.php?id=36744

Apparently it requires NVSE, so it's not in the default list of functions?
User avatar
Connie Thomas
 
Posts: 3362
Joined: Sun Nov 19, 2006 9:58 am

Post » Wed Jan 20, 2010 2:53 pm

Armour Repair Kits
http://www.newvegasnexus.com/downloads/file.php?id=36744

Apparently it requires NVSE, so it's not in the default list of functions?


NVSE does sometimes mean that it is not something geckscript can do on its own, I will guess this is one of these cases.
User avatar
sarah taylor
 
Posts: 3490
Joined: Thu Nov 16, 2006 3:36 pm

Post » Wed Jan 20, 2010 7:38 pm

NVSE always means that, really. ;)

This may not be needed since - as posted above - I've already made Armour Repair Kits, but to answer kavok's question; the equivalent functions are http://fose.silverlock.org/fose_command_doc.html#GetEquippedCurrentHealth and http://fose.silverlock.org/fose_command_doc.html#SetEquippedCurrentHealth. Note however that they don't get/set a percentage, but the actual health value instead. So you'll also need to use http://fose.silverlock.org/fose_command_doc.html#GetHealth to get the maximum health and do a calculation to get a percentage value.

These are all FOSE/NVSE functions, of course. :)
User avatar
mollypop
 
Posts: 3420
Joined: Fri Jan 05, 2007 1:47 am

Post » Wed Jan 20, 2010 2:36 pm

NVSE always means that, really. ;)



But, it doesn't. I keep seeing people doing things with NVSE which I know can be done without it. When it happens I think it is because they have such familiarity with nvse and not as much with unassisted geckscript.
User avatar
BRIANNA
 
Posts: 3438
Joined: Thu Jan 11, 2007 7:51 pm

Post » Wed Jan 20, 2010 5:58 pm

Lazy mod authors are lazy.

(Personally, I try to do as much as possible without NVSE or FOSE. Only if it absolutely can't be done will I consider making the mod depend on NVSE/FOSE.)
User avatar
Cameron Garrod
 
Posts: 3427
Joined: Sat Jun 30, 2007 7:46 am

Post » Wed Jan 20, 2010 11:00 pm

NVSE does sometimes mean that it is not something geckscript can do on its own, I will guess this is one of these cases.

Does Label/Goto count? :whistling:
User avatar
Kelly Tomlinson
 
Posts: 3503
Joined: Sat Jul 08, 2006 11:57 pm

Post » Wed Jan 20, 2010 2:36 pm

Does Label/Goto count? :whistling:


No.

I can create modular structure without goto by using variables to control my process flow.
User avatar
Marnesia Steele
 
Posts: 3398
Joined: Thu Aug 09, 2007 10:11 pm

Post » Wed Jan 20, 2010 7:18 pm

No.

I can create modular structure without goto by using variables to control my process flow.


Label/GoTo are more commonly used for loops (which genuinely can not be done without NVSE) than for 'controlling process flow'.
User avatar
trisha punch
 
Posts: 3410
Joined: Thu Jul 13, 2006 5:38 am

Post » Wed Jan 20, 2010 10:02 pm

Label/GoTo are more commonly used for loops (which genuinely can not be done without NVSE) than for 'controlling process flow'.


I can loop without goto in geckscript, in fact it comes naturally to it. It's just that you do your loop in a fashion to where it loops once per game frame.
User avatar
Jerry Jr. Ortiz
 
Posts: 3457
Joined: Fri Nov 23, 2007 12:39 pm

Post » Wed Jan 20, 2010 4:00 pm

I can loop without goto in geckscript, in fact it comes naturally to it. It's just that you do your loop in a fashion to where it loops once per game frame.
Not particularly useful when you need to do something like loop through every actor in a cell.

NVSE functions almost always do things that would not be possible without NVSE, although sometimes they will be used to implement a feature which doesn't necessarily require NVSE if the author doesn't know how to implement the functionality without the use of NVSE.

When I'm writing scripts, I usually don't shy away from using NVSE/FOSE at all. Of course if none of its functions are required then I won't use it, but if it does something like offer a significantly more efficient method of doing the same thing that I could do without it, like reference-walking vs. scripted explosions placed via http://geck.gamesas.com/index.php/PlaceAtMe, then I'll use the NVSE/FOSE method.

Cipscis
User avatar
Milagros Osorio
 
Posts: 3426
Joined: Fri Aug 25, 2006 4:33 pm

Post » Wed Jan 20, 2010 7:26 pm

But, it doesn't. I keep seeing people doing things with NVSE which I know can be done without it.


What I meant was that NVSE functions are things that don't exist in geckscript, and therefore always require NVSE - by definition. I realise that there are things you can do with NVSE functions that can also be done without them. Maybe I was just being pedantic, or overly literal, or something. :shrug: It was actually a joke.
User avatar
Ladymorphine
 
Posts: 3441
Joined: Wed Nov 08, 2006 2:22 pm

Post » Wed Jan 20, 2010 8:56 am

Well, so far I just have not seen much that I could not manage without it. I think that there are some things which people say are impossible but its because they assumed it was impossible or they didnt try hard enough to actually make it work (I don't mean you Cipscis I mean just in general). So far the only thing mentioned in this topic that I can't do in geckscript is get the health value of armor. That is truly off limits to me without fose. Refwalk explosions are not so bad if you know how to use them eh ...

Edit: something I like about doing things this way is that it sorta makes me really, really learn the guts of this thing. Given the chance to go back in time 2 years, I would not change the way I went, because I would have learned less.
User avatar
gemma
 
Posts: 3441
Joined: Tue Jul 25, 2006 7:10 am

Post » Wed Jan 20, 2010 7:20 pm

Refwalk explosions are not so bad if you know how to use them eh ...
They're pretty bad in crowded areas. I haven't yet tested them in New Vegas, but when I tested them in Fallout 3 they reduced my frame rate by over 50% when running at 1 iteration per frame, which is more often than I would expect them to be run but still enough for them to introduce noticeable stutter. Decreasing the explosion radius could reduce this effect, but would also reduce the effective range of whatever you're trying to do.

Looping through references via NVSE's reference-walking functions also allows access to non-actor references, and dead actors.

It's certainly good to think about how a feature could be implemented without the use of the script extender - I think that thinking about different ways of doing the same thing is always going to be beneficial - but I tend to treat script extender functions and vanilla functions the same when modding, in that I won't avoid the script extender functions if I can see a benefit in not doing so.

It's also worth noting that there are fewer users of New Vegas that cannot use NVSE than Fallout 3 users that cannot use FOSE, if I remember correctly.

Cipscis
User avatar
Catharine Krupinski
 
Posts: 3377
Joined: Sun Aug 12, 2007 3:39 pm


Return to Fallout: New Vegas