• Announcements

    • Ashal

      SITE MOVED - IN READ ONLY MODE   12/08/2015

      Please use http://www.loverslab.com moving forward. Site has been restored to a previous version, and this one placed into a read-only mode. This is available for a limited time so users may reference/copy content that has been lost in the transition. This will no longer be accessible by December 22nd, 2015.

Xilandro

Members
  • Content count

    54
  • Joined

  • Last visited

Posts posted by Xilandro


  1. IsPlayable works only with armours? Ugh-oh.. Lots of my scripts rely on that function to make sure tokens or any other items marked "non playable" (from other mods or vanilla) are not affected by anything what I'm doing with regular items. Sp weapons and ammo fix will be extremely useful.)


    0

  2. Does anyone know for sure if HasPerk does or doesn't return the perk rank when used in-script?

    The wiki kinda suggests it only returns a boolean.

     

     

    Lutana NVSE plugin just got updated to V5, now it has "HasPerkRank" function.

     

    (rank:int) playerref.HasPerkRank perk:ref

    It'll return the rank of the perk you pass to it and zero if you don't have it, so you can use it as a general replacement for HasPerk.

     

    also take a look at this info:

     

     

    I also found and defined the "alternate" perk list, which is used with AddPerk, RemovePerk, and HasPerk when you pass "1" as a second argument, so HasPerkRank will search that list if you pass the same to it.

    In case you're wondering about the little-known "alternate" perk list:

    Perks in this list don't apply their effects to the player, but to other actors that are set as followers using SetPlayerTeammate.

    For example:

    player.AddPerk Toughness 1

    This will add the Toughness perk's +3 DT effect to all of the player's followers and not to the player.

    To get rid of this effect on followers:

    player.RemovePerk Toughness 1
    Of course, you can check for perks in this list with:
    player.HasPerk Toughness 1
    or newly:
    player.HasPerkRank 1
    which will return the rank.

     

     

    0

  3. I have a little request for new function (not right now though, but for the future updates, I know there's a lot of other, more complicated things in NVSE with higher priority).


    Player.HasPerk SomePerkID returns 1 or 0 in script, and returns "perk rank →→ 1" if typed into console.


    It will be great to get some HasPerk2 function that will return this string via script, so I can just do Let svRank := Player.HasPerk2 SomePerkID, and svRank will be "perk rank →→ 1"


    I know people were looking for solution how to track perk ranks for a long time, and still  there's only one way to track it, new entry point for each rank with ability that will +1 some value (and incompatibility issues bc of such way of tracking). But string var with "perk rank" will fix it once and for all.


    0

  4. Nope. Something like this http://www.gamemapscout.com/falloutnewvegas_interactive.html but with more options. User markers, quest tracking (just like in vanilla Pipboy, but it's definitely out of the current NVSE functionality, so it will probably require some more coding =\), wiki info, maybe something else what we can add on map or what we can do with map.


     




    sorry I was confused. I said that you should do less talking and more action.   I just expresed my opinion that UI is not "WOW! OMG I've been waiting for this since 2009" mod. And you started saying that it's just a beginning. So I say that if you can do  something that is not "piece of crappy font strings on the display" before telling us about possibilities.




     


    Harsh..)


    No, my friend. I already did some action to show possibilities. Now I'm doing talking for those who like to see things from mod user point of view to show them what exactly is WOW OMG (not UI mod) =D


    0

  5. Don't understand pother about that mod - nothing special I think.

     

    From mod user point of view - it's a piece of crappy font strings on the display, and I agree with such point xD From scripting point of view - it's a little bit different.

    Like DoctaSax said a month ago in array tutorial:

     

    this stuff's just begging to be used.

     

    And what's the best use of arrays, strings and UDFs all together? Managing extreme amounts of information, refs, vals, vars, hex, blabla, and output it all in a nice, little (but unlimited) grid, if you want. That's what this inventory menu is made of (+ some magic from Jaam) =) So, what's so special? Possibilities. This menu is just one way to use all the functionality we have now in NVSE4+.

    What's next? How about interactive map (like those made in flash, available for download from the internet)? Clothing eval menu out of the MCM? Nice little contraceptive menu pop-up? Or complete rework of whole RPG system, dynamic, easy to tweak and kicking vanilla in the face? Who knows) Easy? No. Possible? Yes. How? NVSE4+.

    0

  6. Okay, got my rest, feel better now. And little bit confused. Looks like I need new subarray for every new form+number.  Like subarray1, subarray2, subarray3, subarray4, etc. And I will end up with 50+ subarrays =\ That's a good way, but the more items - more subs. Anyway, thank you for your time good sir, I really appreciate your help =3


    0

  7. Yeah, UDF example in tutorial is great, so I understand how it works. And thanks for new comparison for $forms =) The thing I can't get is this:

    [0][0] := base object 1

    [0][1] := condition for the inv ref (I guess)

     

    How can I have an array with [0][0] and [0][1] keys? I'm definitely loosing logic.

    Tried something like this.

    for array

    ar_append array1[0][0] Form
    let array1[0][0] := Form

    for stringmap

    let array1["0"][0] := Form

    Obviously, it's not working) I'm doing something very stupid, 100%

    0

  8. There may be other solutions here, but I think maybe you should stick all the intel in a sub-array:

    [0][0] := base object 1

    [0][1] := condition for the inv ref (I guess)

    [1][0] := base object 2

    and so on

     

    and then sort your primary array with ar_customsort and a UDF that checks sv_compare between the names of the base forms. Either way, base forms & condition stay attached.

     

    I have no idea how to, I'm too tired to understand even simple things, but once I get some sleep - I will try. Thank you very much!

    0

  9. I have a serious problem with my arrays, and I'm in deep frustration, bc I have no idea how I can fix it.


     


    I have 2 arrays, array1 full of base objects, array2 full of values (condition, I can gather those values only once with Inventory references ForEach). Those values are at the same keys as base objects in array1. It looks like this:


    DiSCtFtl.jpg


     


    And I'm happy with it basically, until I try to sort arrays.


    If I will sort array1 by name - I want array2 elements get sorted as well. So, if 9mm Pistol in array1 at key [3.00] after sorting (into array3) is at key [12.0] - I want array2 element at key [3.00] be at key [12.0] (in array4)


    So I will have nice alphabetically sorted array3 with base objects and I will be able to access their values at same keys in array4.


    Thought about using stringmap, but keys with the same name will not work.


     


    Right now I'm thinking about to keep all the info in one array like "[0.00] 9mm Pistol___0.3", sort it, and then loop through that array and sv_split  each element into new array and ar_append new elements into 2 new arrays..  something like that, clearly have no idea if this thing will work at all.


     


    update. This thing worked fine



    foreach loop
    let  SomeString := $Iter + "___" + $Condition
    ar_append array1 $SomeString


    if nuked == 1
    let ArraySorted := ar_sortalpha array1
    let iSize := ar_size ArraySorted
    set nuked to 2
    endif

    if nuked == 2
                        if iSize != 0
                                    let array2 := sv_split $ArraySorted[0] "___"
                                    ar_append array3 array2[0]
                                    ar_append array4 array2[1]
                                    ar_erase ArraySorted 0
                            set isize to isize -1
                        elseif isize == 0
                            set nuked to 3
                        endif
    endif

    A little bit slow due to iSize to iSize -1, but at least something =\


    Still curious maybe there's a less strange and faster way to achieve what I need.


     


    Uptade2


    Just realized that I can't access such data as GetBaseDamage from array containing base objects, because they are stings. Oh dear...


    0

  10. Wow, thanks a lot for detailed and useful answers =)

    All this info is unique and very useful for people who heard about bloats, but, like me, was unsure what causes them. Somebody should gather all this info and make a small but awesome tutorial =)
     

    I also think it's a problem when a spawned npc has a script running on it (i.e. spawned enemies who heal themselves when health < a certain value, or they buff with psycho / spells / etc. I did some in the past), since the script doesn't stop running after the death.

    I always thought those scripts will stop after the death. That's interesting.

    how about something like this?

    If bDoOnce == 0Set rSelf to GetSelfset bDoOnce to 1endifif rSelf.GetDead != 1 ;do all the fancy stuffelsereturnendifend

    For corpse degrading this should be interesting to point out, especially when people like me play with a low timescale, I guess the corpses will remain a long time in game even if not marked as Quests, so a lot of istances of the same scripts will remain on the savegame. I guess.

     

    Non quest corpses are removed from the game after 3 days. Not a huge number actually. I'm also playing with a low timescale, and that's why I've added mcm with settings like max corpse number, decay stages time, and max corpse life.

    0

  11. So, in most cases bloat is caused by references without markfordelete and string_vars (and those are gone after mod uninstallation anyway). Then why people are complaining about bloating the savegame if there's only few things that will do such bloat =) were working on corpse decay feature and people start throwing rocks at me "Bloats! You will break my stable mod built! Savegames will be corrupted!"


     


    Haven't work with Skyrim scripts yet. Heard something about scripts are baked into the savegame directly o_O


    0

  12. This line will calculate once per frame anyway: set PlayerHeight to Player.GetPos Z


    So, without var you have same thing calculating twice per frame, with var - only once per frame. I can't see the difference in performance between this two variants. I'm sure I saw somewhere a thread about script optimisation and a lot functions tests. I should try to find it and look if there's something about getpos


    0

  13. In case my theory about calculating player pos twice is correct, you can avoid calculating player pos for 60 times a second!!

    Fair, but getpos is not as heavy as you think. And less variables is good for script length =)

    And you can't make bDoOnce if script is dynamic and player's Z is changing. So set PlayerHeight to Player.GetPos Z will run [fps] times per second anyway. One more - one less, it's very subtle func, so you will never notice it (like sin, tan or ref walking, for example)

    set PlayerHeight to Player.GetPos Z

    let ZDiffTemp := (CamDestREF.GetPos Z) - (PlayerHeight)

    versus

     let ZDiffTemp := (CamDestREF.GetPos Z) - (Player.GetPos Z)

    0

  14. Yep, offset is required indeed, but so far - both scripts aim right into the head, so it's fine. By the accuracy I mean OffsetZ/iDistance. The closer and higher you are - less accurate script will be and aim will be above the target. Not critical for camera mod, but for autoaim - a dead end.


    I'm sure there's something cool in the trig I don't know that can fix this problem once and for all =D


    0

  15. sqrt because I'm calculating hypotenuse in a triangle where the catheti are GetDistance and the Z offset.

    Here's the script

    let Dist := CamDestREF.GetDistance Player

    let ZDiffTemp := (CamDestREF.GetPos Z) - (Player.GetPos Z)

    let CatSumTemp := ((ZDiffTemp * ZDiffTemp) + (Dist * Dist))

    let HypTemp := sqrt CatSumTemp

    let DivTemp := Dist / HypTemp

    if (CamDestREF.GetPos Z) >= (Player.GetPos Z)

    let aCamMQ.pcXGap := (90 - (sin DivTemp 1)) / frame

    else

    let aCamMQ.pcXGap := (-90 + (sin DivTemp 1)) / frame

    endif

    In the last part I divide for "frame" since mine is an interpolation movement

     

    So this is how it should be =)) Almost similar to arctan way, but seems like this code is a lot more accurate. Will test in a few minutes

     

    UPD

     

    Nope, accuracy is just the same as with arctan. But this script don't need manual numbers =)

     

    here's my script

                set CameraZ to getgamesetting fovershoulderposZ

                set iDistance to Player.GetDistance rLast

                set TanCalc to 0 - (iDistance / 1000)

                set rLastPosZ to rLast.GetPos Z

                set PlayerPosZ to Player.GetPos Z

                set OffsetZ to (rLastPosZ - PlayerPosZ) - (CameraZ * 1.15)

                set AngleXcalc to 0 - (OffsetZ/iDistance)

                set ArcTan to tan AngleXcalc 1

                Player.SetAngle X ArcTan

    0