critter facing

Nirran

Vault Senior Citizen
Modder
is it possible to return what facing FID a critter is currently using?i would like to make a mod that sets to hit(and possibly damage) penalties for having your back to the attacker

Nirran
 
Nirran said:
is it possible to return what facing FID a critter is currently using?i would like to make a mod that sets to hit(and possibly damage) penalties for having your back to the attacker

Nirran

Maybe write something like:

self_obj is the critter dude is fighting with.

Code:
if (rotation(self_obj) == get_rotation_away_from_dude(self_obj)) then begin
   //add here penalty/bonus code
end

If you want the code to affect the dude, you would have to write:

Code:
if (rotation(dude_obj) == rotation_to_tile(self_obj,dude_obj)) then begin
   //penalties
end

It isn't really returning the FID, but if you check that the critter's rotation is turned from the attacker, it would basically be the same, no? Is that what you wanted to achieve, or did I get you completely wrong? :oops:

Anyway, that's just a quick idea I had, never tested it, and of course it may need tuning.

Good luck.
 
no yea are right,ill try that thnx

edit : this always returns 2,donno if im doing anything wrong,klint is in party and i moved around to different sides and distances from him

Code:
rotation_to_tile(tile_num(dude_obj),tile_num(Klint_Ptr))

Nirran
 
actualy found what i was looking for a few min ago

Code:
has_trait(TRAIT_OBJECT,dude_obj,OBJECT_CUR_ROT)

edit : this will return 2 critters facing in regards to eachother

Code:
         if(has_trait(TRAIT_OBJECT,dude_obj,OBJECT_CUR_ROT) == has_trait(TRAIT_OBJECT,Sulik_Ptr,OBJECT_CUR_ROT)) then 
            begin
               display_msg("Backstab");
            end 
         else 
            if (has_trait(TRAIT_OBJECT,dude_obj,OBJECT_CUR_ROT) == has_trait(TRAIT_OBJECT,Sulik_Ptr,OBJECT_CUR_ROT ) + 1)
         or (has_trait(TRAIT_OBJECT,dude_obj,OBJECT_CUR_ROT) == has_trait(TRAIT_OBJECT,Sulik_Ptr,OBJECT_CUR_ROT) - 1) then begin
            display_msg("Rear Flank");
         end 
         else 
            if (has_trait(TRAIT_OBJECT,dude_obj,OBJECT_CUR_ROT) == has_trait(TRAIT_OBJECT,Sulik_Ptr,OBJECT_CUR_ROT) + 2)
         or (has_trait(TRAIT_OBJECT,dude_obj,OBJECT_CUR_ROT) == has_trait(TRAIT_OBJECT,Sulik_Ptr,OBJECT_CUR_ROT) - 2) then begin
            display_msg("Front Flank");
         end 
         else 
            if (has_trait(TRAIT_OBJECT,dude_obj,OBJECT_CUR_ROT) == has_trait(TRAIT_OBJECT,Sulik_Ptr,OBJECT_CUR_ROT) + 3)
         or (has_trait(TRAIT_OBJECT,dude_obj,OBJECT_CUR_ROT) == has_trait(TRAIT_OBJECT,Sulik_Ptr,OBJECT_CUR_ROT) - 3) then begin
            display_msg("Face to Face");
         end

Nirran
 
Nice! this will add much needed realism to the combat system. The idea is similar to the steal penalties if you steal right in front of someone as opposed to the side or behind them, yes?
 
Back
Top