Get Equpied Armor

Post » Sat Aug 28, 2010 2:27 pm

I am curious if it is possible to get the a section of the name of the players current equipped armor?

Example:
=======
Advanced Combat Armor - Get the word Advanced?
User avatar
Soph
 
Posts: 3499
Joined: Fri Oct 13, 2006 8:24 am

Post » Sat Aug 28, 2010 1:22 pm

You can do it with FOSE if the functions have been ported from OBSE. http://cs.elderscrolls.com/constwiki/index.php/NameIncludes and http://cs.elderscrolls.com/constwiki/index.php/GetEquippedObject This is obviously the Oblivion CS pages, but they are relevant.
User avatar
Trista Jim
 
Posts: 3308
Joined: Sat Aug 25, 2007 10:39 pm

Post » Sat Aug 28, 2010 1:41 pm

Yes indeed.

Ref rArmorSet rArmor to ActorRef.GetEqObj 2


Will return the calling actor's armor.
User avatar
Hairul Hafis
 
Posts: 3516
Joined: Mon Oct 29, 2007 12:22 am

Post » Sat Aug 28, 2010 12:48 pm

Yes indeed.

Ref rArmorSet rArmor to ActorRef.GetEqObj 2


Will return the calling actor's armor.


thank you pkleiss, I have looked at the FOSE command list but I do not see the "NameIncludes" command - do you know of a way to get a part of the name?
User avatar
Eibe Novy
 
Posts: 3510
Joined: Fri Apr 27, 2007 1:32 am

Post » Sat Aug 28, 2010 4:26 pm

AFAIK There is no NameIncludes function for FOSE. Give me a more detailed explanation of what you are trying to accomplish and I'll try to help you find a solution.
User avatar
James Rhead
 
Posts: 3474
Joined: Sat Jul 14, 2007 7:32 am

Post » Sat Aug 28, 2010 5:19 am

AFAIK There is no NameIncludes function for FOSE. Give me a more detailed explanation of what you are trying to accomplish and I'll try to help you find a solution.



What I want to do is get the name of the players equipped armor and if it includes advanced give them a special ability.
User avatar
Cathrine Jack
 
Posts: 3329
Joined: Sat Dec 02, 2006 1:29 am

Post » Sat Aug 28, 2010 6:33 pm

The easiest way to do this should be using form lists.
Create a new form list and add all "advanced" armors, then based on the previous examples:
Ref rArmorSet rArmor to ActorRef.GetEqObj 2if listGetFormIndex advancedArmorsList rArmor != -1 ; advanced armor equippedendif


User avatar
naomi
 
Posts: 3400
Joined: Tue Jul 11, 2006 2:58 pm

Post » Sat Aug 28, 2010 3:28 am

Make a http://geck.gamesas.com/index.php/FormList that includes all the armor you want to add the special ability for, then use http://geck.gamesas.com/index.php/IsInList to check if the returned armor from the GetEqObj command is in that list. If so, add the ability.

Edit: Aside from the Advanced Radiation Suit, what other armor has the word Advanced in it?
User avatar
Monika Fiolek
 
Posts: 3472
Joined: Tue Jun 20, 2006 6:57 pm

Post » Sat Aug 28, 2010 3:49 pm

The easiest way to do this should be using form lists.
Create a new form list and add all "advanced" armors, then based on the previous examples:
Ref rArmorSet rArmor to ActorRef.GetEqObj 2if listGetFormIndex advancedArmorsList rArmor != -1 ; advanced armor equippedendif



Alright let me become more exact. I was only using that as an example, my real mod I am working on is a dynamic Disguise mod that gets the name of the armor you are wearing and then adds you to that faction this way it is completely compatible with all mods.

If you were wearing Raider Iconoclast Armor it would add you to the raiders faction.

Brotherhood Advanced Combat Mr. II would add you to the Brotherhood faction.

I wanted to do this in oblivion but the armors went named as perfect for this as they are in fallout. 90% of the armors that raiders are wearing have the name raider in it.

I was maybe thing of making in external file that the mod could read from and then expot all of the armor from FOOK and if FWE has armors FWE as well. But I was curious if there was an easier way first.
User avatar
Ashley Clifft
 
Posts: 3468
Joined: Thu Jul 26, 2007 5:56 am

Post » Sat Aug 28, 2010 3:01 am

You could still make formlists, one for each faction and include all the possible armor in each list. I don't know how you would account for custom modded armor though.
User avatar
Hayley O'Gara
 
Posts: 3465
Joined: Wed Nov 22, 2006 2:53 am

Post » Sat Aug 28, 2010 4:07 am

You could still make formlists, one for each faction and include all the possible armor in each list. I don't know how you would account for custom modded armor though.



I guess I am going to have to request the "NameIncludes" command to be added to FOSE
User avatar
Add Meeh
 
Posts: 3326
Joined: Sat Jan 06, 2007 8:09 am

Post » Sat Aug 28, 2010 4:30 pm

Yep, making it really dynamic will be difficult. One idea you might try to pursue:
Ref walk actors in the current cell. If they wear an armor you are wearing, you're added to their faction.
User avatar
Taylor Tifany
 
Posts: 3555
Joined: Sun Jun 25, 2006 7:22 am

Post » Sat Aug 28, 2010 12:35 pm

Yep, making it really dynamic will be difficult. One idea you might try to pursue:
Ref walk actors in the current cell. If they wear an armor you are wearing, you're added to their faction.



That could work. I might have to try that. Thanks. Yeah but what if you are wearing a raider armor and are near raiders that are not wearing that type of armor.

Chalk it up to as they realized you were just pretending?
User avatar
Brian Newman
 
Posts: 3466
Joined: Tue Oct 16, 2007 3:36 pm

Post » Sat Aug 28, 2010 6:26 am

Even with a NameIncludes function, there is no guarantee that all modded armor would follow your desired naming convention. So certainly many an armor would be unaffected anyway.
User avatar
No Name
 
Posts: 3456
Joined: Mon Dec 03, 2007 2:30 am

Post » Sat Aug 28, 2010 3:46 am

Yes something like that :) Usually there are groups of them so chances are that someone wears your armor.

A more advanced approach, though I dont really know if I considered everything:

Make some sort of self-learning system.

List A: Contains factions
List B: Contains a list for each faction, containing items ever worn by this faction.

A is initially empty, B has to be prepopulated with empty lsits since you cant create them on the fly (but make lets say 30 or so and you should be safe)

Then, a script is running in the background, ref walking all actors every 10 seconds or so, and for every faction they are in their worn armor is recorded in the respective list.

Edit: If getting all factions an actor is in is not possible, you would have to pre-populate list A.
Also, since this system would never forget anything (which might not be desireable), have recently detected items moved to the front of the list even if they are already in it. then, every 10 minutes or so, the last element is removed, so "one-timers" will be purged eventually.
User avatar
Red Bevinz
 
Posts: 3318
Joined: Thu Sep 20, 2007 7:25 am

Post » Sat Aug 28, 2010 6:38 pm

Even with a NameIncludes function, there is no guarantee that all modded armor would follow your desired naming convention. So certainly many an armor would be unaffected anyway.


I know what your are saying that is why I also included that about 90% of the armors. I use almost 250 something mods. I still havent found a raider armor in my game that does not include the word raider in it. I do understand that the chances of an armor put in through a mod that a raider would wear that would not include the word raider is bound to exist. I will have to change completely, to almost.

Yes something like that :) Usually there are groups of them so chances are that someone wears your armor.

A more advanced approach, though I dont really know if I considered everything:

Make some sort of self-learning system.

List A: Contains factions
List B: Contains a list for each faction, containing items ever worn by this faction.

A is initially empty, B has to be prepopulated with empty lsits since you cant create them on the fly (but make lets say 30 or so and you should be safe)

Then, a script is running in the background, ref walking all actors every 10 seconds or so, and for every faction they are in their worn armor is recorded in the respective list.



I think I am going to go with the ref walking all actors and if one of them is wearing the same armor you are added to the faction. To me it seems as if it would be a little easier on peoples system.

Plus if for some reason the raider armor you are wearing is not found in that group then it just seems like they realized you are just pulling their strings.
User avatar
Rex Help
 
Posts: 3380
Joined: Mon Jun 18, 2007 6:52 pm

Post » Sat Aug 28, 2010 6:47 am

Well it's your choice :)
Of course I'm by no means any reference, but you should check out what the current Helmet POV scripts do every Other than that, I checked out if there's some sort of getNthFaction, and I didnt find anything, so you will need to pre-create a Formlist with all known factions anyway. I think the 2nd version would work pretty well.
User avatar
Rinceoir
 
Posts: 3407
Joined: Thu Jun 29, 2006 1:54 am

Post » Sat Aug 28, 2010 3:37 pm

Thanks for the help. Its not as i just started working on it. Its going to be a plug in for my Apocalyptic - A Harsher Wasteland mod. I just wanted to get a rough idea how hard it would be to create thanks for the help, again.
User avatar
anna ley
 
Posts: 3382
Joined: Fri Jul 07, 2006 2:04 am

Post » Sat Aug 28, 2010 5:31 pm

Hey, I wish you luck, becasue that's not an easy chore to accomplish.
User avatar
Lynne Hinton
 
Posts: 3388
Joined: Wed Nov 15, 2006 4:24 am


Return to Fallout 3