(MOD)TorchLight

+

(MOD)TorchLight

  • TorchLight Realistic

    Votes: 3 50.0%
  • TorchLight More Brightness

    Votes: 1 16.7%
  • TorchLight Daker

    Votes: 0 0.0%
  • TorchLigte Hot Color

    Votes: 1 16.7%
  • TorchLigte Hot Color II

    Votes: 1 16.7%

  • Total voters
    6
KanaTheKana;n9943811 said:
No E3 torchlight ? :(

TorchLight is 100% Compatible With mods using environment files.But , if your mod contain file torch.w2ent in conflict with your mod after scan with WitcherScriptMerger , set priority on TorchLight 01


 
Last edited:
Now, if you ave idea for GUI Menu.
It's possible to use it with DLC, and script.
For edit another light source :

You ave 4 choices
1-Edit each env files
2-edit each LightSource in Decoration folder
Open .W2ent files.



Remove line ECG_FX_FireLight

Open flatCompileData
Edit CPointLightComponent#
and change color x/y/z and w is for brightness Group
Remove line ECG_FX_FireLight

3- Another option is create script for Work with DLC, With many files for xxxlight, example one for world and one for underworld.
same script for use day and night.

4- And for last option. Edit files in Level Folder, at line with load .env file. Change it for your choice.
 
For script i ave this: for Playerwitcher.ws

Code:
    //TouchLightMod
    private var mTouchLightMod : TouchLightMod;
    //TouchLightMod



        //TouchLightMod
        mTouchLightMod = new TouchLightMod in this;
        AddTimer('InitTouchLightMod', 3.0, false);
        //TouchLightMod


    //TouchLightMod
    timer function InitTouchLightMod(dt : float, id : int) {

        mTouchLightMod.Init();
        mTouchLightMod.DisplayWelcomeMessage();


    //TouchLightMod

And this for local:

Code:
class TouchLightMod {

private var blendOutTime                         : Int32;
private var TouchLight                               : array<String>;
private var TouchLightEnabled                    : bool;
private var TouchLightColorPickerEnabled         : bool;

private var inGameConfigWrapper                 : CInGameConfigWrapper;

public function Init() {

                inGameConfigWrapper = theGame.GetInGameConfigWrapper();


                TouchLightEnabled = inGameConfigWrapper.GetVarValue('TouchLightMenu', 'TouchLightMode');

                blendOutTime = 0;                                       

                if (TouchLightEnabled) {

                    EnableTouchLight();

                }

}    
public function EnableTouchLight() {

    var xTintRed                : Int32;
    var yTintGreen                : Int32;     
    var zTintBlue                : Int32;
    var wIntensity                : Int32;


    TouchLightColorPickerEnabled = inGameConfigWrapper.GetVarValue('TouchLightMenuColorPicker', 'EnableTouchLightColor');



    if(TouchLightColorPickerEnabled) {

        xTintRed = StringToInt(inGameConfigWrapper.GetVarValue('TouchLightMenuColorPicker', 'TintRed'));
        yintGreen = StringToInt(inGameConfigWrapper.GetVarValue('TouchLightMenuColorPicker', 'TintGreen'));
        zTintBlue = StringToInt(inGameConfigWrapper.GetVarValue('TouchLightMenuColorPicker', 'TintBlue'));
        wIntensity = StringToInt(inGameConfigWrapper.GetVarValue('TouchLightMenuColorPicker', 'Intensity'));

    }

}

public function DisplayWelcomeMessage() {

    var title : String;

    title = "TouchLight Mod initialized";

    GetWitcherPlayer().DisplayHudMessage(title);

    }


}

class TouchLightInit extends W3PlayerWitcher {

    event OnSpawned( spawnData : SEntitySpawnData )


    }

}

Menu :

Code:
<?xml version="1.0" encoding="UTF-16"?>
<UserConfig>
    <Group id="TouchLightMenu" displayName="Mods.TouchLight.Settings">
        <VisibleVars>             
        <Var id="TouchLightMode" displayName="Enable TouchLight Mode" displayType="TOGGLE"
                tags="customNames;nonLocalized;customDisplayName"/>    
        </VisibleVars>
    </Group>    
    <Group id="TouchLightMenuColorPicker" displayName="Mods.Touch Light">
        <VisibleVars>

        <Var id="EnableTouchLightColorPicker" displayName="Enable TouchLight Colorizer" displayType="TOGGLE"
                tags="customNames;nonLocalized;customDisplayName"/>
        <Var id="TouchLightTintRed" displayName="TouchLight Tint Red"
                displayType="SLIDER;0;255;255" tags="customNames;nonLocalized;customDisplayName"/>
        <Var id="TouchLightTintGreen" displayName="TouchLight Tint Green"
                displayType="SLIDER;0;255;255" tags="customNames;nonLocalized;customDisplayName"/>
        <Var id="TouchLightTintBlue" displayName="TouchLight Tint Blue"
                displayType="SLIDER;0;255;255" tags="customNames;nonLocalized;customDisplayName"/>
        <Var id="TouchLightIntencity" displayName="TouchLight Tint Intencity"
                displayType="SLIDER;0;255;255" tags="customNames;nonLocalized;customDisplayName"/>     
        </VisibleVars>
    </Group>
</UserConfig>

Can you help me?

 

Guest 3841499

Guest
Now apply all that awesome voodoo to Toussaint light sources (at least torches), please! Then we can have SHADOWS!
 
Now for menu GUI





Code:
<?xml version="1.0" encoding="UTF-16"?>
<UserConfig>
    <Group id="ModTorchLight" displayName="Mods.ModTorchLight" >
        <VisibleVars>
            <Var id="ModEnabled" displayName="ModEnabled" displayType="TOGGLE"/>        
            <Var id="TLchoice"     displayName="option_TLchoice"     displayType="OPTIONS" tags="customNames;customDisplayName">
            <OptionsArray>
                    <Option id="0" displayName="TLHC">
                        <Entry varId="TLchoice" value="0"/>
                    </Option>
                    <Option id="1" displayName="TLDark">
                        <Entry varId="TLchoice" value="1"/>
                    </Option>
                    <Option id="2" displayName="TLRealistic">
                        <Entry varId="TLchoice" value="2"/>
                    </Option>
                    <Option id="3" displayName="TLBrightness">
                        <Entry varId="TLchoice" value="3"/>
                    </Option>                
            </OptionsArray>
            </Var>                 
        </VisibleVars>
    </Group>    
</UserConfig>

String:

Code:
;meta[language=en]
; id      |key(hex)|key(str)| text
2112810100|4d5f8b0c|Mods|Mods;
2112810101||panel_ModTorchLight|TorchLight
2112810102||option_TLchoice|Choice
2112810103||TLHC|TLHC Immersion
2112810104||Vanilla|Vanilla
2112810105||TLDark|Dark
2112810106||TLRealistic|Realistic
2112810107||TLBrightness|Brightness
2112810108||ModEnabled|Mod Enabled

Now ,

Now I have to create a script code for the GUI menu queries.
I could refer to the work of the CAPA14 script, with AMM.
AMM uses the GUI menu requests for these 2Went files in DLC mode.

Is it possible or not?


CAPA14 script, with AMM:
Code:
function AccessoriesArrayInit(){
accessoriesArray.PushBack("dlc\ammdlc\data\knife\originalknife.w2ent");//Original Knife DLC
accessoriesArray.PushBack("dlc\ammdlc\data\knife\knife.w2ent");//Repositioned Knife DLC
accessoriesArray.PushBack("dlc\ammdlc\data\bearscarf\bearscarf.w2ent");// BearScarf! DLC
accessoriesArray.PushBack("dlc\ammdlc\data\cat_chest_belt\cat_chest_belt.w2ent"); //Cat Chest Belt DLC
}

CKNG script CKNGWISP

Code:
statemachine class CKNGWISP extends W3UsableItem {

    private var resourcePath     :  string;

    //event called when item is used
    event OnUsed(usedBy : CEntity) {

        super.OnUsed(usedBy);

        //resource to load
        resourcePath = "dlc\dlckngwisp\data\w2ent\kngwisp.w2ent";

        //entityTemplate
        entityTemplate = (CEntityTemplate)LoadResource(resourcePath,true);
 
Last edited:
I would like to have an opinion of an encoder please.

Now i select this code

Code:
var igconfig : CInGameConfigWrapper;
var myValue : float;

igconfig = theGame.GetInGameConfigWrapper();

//getting a value
myValue = StringToFloat(igconfig.GetVarValue('ModTorchLight', 'TLchoice'));

//setting a value
igconfig.SetVarValue('ModTorchLight', 'TLchoice', FloatToString(1.0f));


Code:
statemachine class Uphenix extends W3UsableItem {

    private var entityTemplate                                                          :  CEntityTemplate;
    private var resourcePath                                                               :  string;  

        event OnUsed(usedBy : CEntity) {

        super.OnUsed(usedBy);

        if(myValue = 0) {        

                resourcePath = "dlc\dlckngwisp\data\w2ent\kngwisp.w2ent";
                entityTemplate = (CEntityTemplate)LoadResource(resourcePath,true);
            }            
        if(myValue = 1) {        

                resourcePath = "dlc\dlckngwisp\data\w2ent\kngwisp.w2ent";
                entityTemplate = (CEntityTemplate)LoadResource(resourcePath,true);
            }
        if(myValue = 2) {        

                resourcePath = "dlc\dlckngwisp\data\w2ent\kngwisp.w2ent";
                entityTemplate = (CEntityTemplate)LoadResource(resourcePath,true);
            }
        if(myValue = 3) {        

                resourcePath = "dlc\dlckngwisp\data\w2ent\kngwisp.w2ent";        
                entityTemplate = (CEntityTemplate)LoadResource(resourcePath,true);
            }
            if(usedBy == thePlayer && !FactsDoesExist("ModEnabled")) {


            else if (active) {

                active = false;                
            }

    igconfig.SetVarValue('ModTorchLight', 'TLchoice', FloatToString(1.0f));



    }  
}

I only miss the script to make a selection in the DLC folder between the file 1,2 or 3
 
Last edited:
syntax error, unexpected TOKEN_IDENT, expecting TOKEN_FUNCTION, near 'myValue'



I try This code for get in stram Option 0,1,2,3 select in GUI Menu, check if player use torch, then change Path for selected files, then return in strem

Code:
function modCreate_dlc_Uphenix() : CMod {

    return new CModTorchLight in thePlayer;
}

class CModTorchLight extends dlc_Uphenix {

    default modName = 'ModTorchLight';
    default modAuthor = "jack3459";
    default modUrl = "http://www.nexusmods.com/witcher3/mods/????/";
    default modVersion = '2.0';
    var targetItem   :  string;
    var ids : SItemUniqueId;    
    var groupGen : CModTorchLight;    
    var torchelight : CEntity;
    var igconfig : CInGameConfigWrapper;
    private var isActive : bool;
    private var resourcePath  :  string;
    private var entityTemplate      :  CEntityTemplate;
    private var TLValue           :  float;    

        // Check if specified item is held
        //import final function IsItemHeld( it_sclub_201 : SItemUniqueId ) : bool;


        TLValue = StringToFloat( igconfig.GetVarValue( 'ModTorchLight', 'TLchoice' ) );
        igconfig.SetVarValue;( 'ModTorchLight', 'ModEnabled', FloatToString(1.0f) );    


tempAccessories1 = CreateTemplate(accessoriesArray[accessories1Selection]);
    if(accessories1Enabled){
        accessories1PrevTemp = GearToogle(true,tempAccessories1,accessories1PrevTemp);
        //theGame.GetGuiManager().ShowNotification((string)accessories1PrevTemp);
    }
    else if(accessories1Enabled == false){
        GearToogle(false,tempAccessories1,accessories1PrevTemp);
    }



        if(TLValue == 0) {        

                resourcePath = "dlc\dlcureal\data\items\usable\torch\torch.w2ent";
                entityTemplate = (CEntityTemplate)LoadResource(resourcePath,true);

            }            
        if(TLValue == 1) {        

                resourcePath = "dlc\dlcureal\data\items\usable\torch\torch1.w2ent";
                entityTemplate = (CEntityTemplate)LoadResource(resourcePath,true);

            }
        if(TLValue == 2) {        

                resourcePath = "dlc\dlcureal\data\items\usable\torch\torch2.w2ent";
                entityTemplate = (CEntityTemplate)LoadResource(resourcePath,true);

            }
        if(TLValue == 3) {        

                resourcePath = "dlc\dlcureal\data\items\usable\torch\torch3.w2ent";        
                entityTemplate = (CEntityTemplate)LoadResource(resourcePath,true);

            }
            targetItem = "items\usable\torch\torch.w2ent";
            upgradeItem = entityTemplate
     public function CanBeUpgradedBy(targetItem : it_sclub_201, upgradeItem : SItemUniqueId) : bool


     }

}
 
Last edited:
Now, Script load buy Select choice torch in dlc not work

Code:
function modCreate_TorchLight() : CTorchLight {

    return new CTorchLight in thePlayer;
}

statemachine class CTorchLight extends W3UsableItem {

//    default modName = 'TorchLight';
//    default modAuthor = "jack3459";
//    default modUrl = "http://www.nexusmods.com/witcher3/mods/????/";
//    default modVersion = '2.0';

    private var inGameConfigWrapper : CInGameConfigWrapper;
    private var active         : bool;
    private var resourcePath  :  string;
    private var entityTemplate      :  CEntityTemplate;
    var TLValue           :  float;  
    private var entity         :  CEntity;
    editable var factAddedOnUse     : string;
    editable var factValue             : int;
    editable var removeFactOnHide     : bool;
    editable var factTimeValid         : int;    


    event OnUsed(usedBy : CEntity) {

        super.OnUsed(usedBy);

        TLValue = StringToFloat(inGameConfigWrapper.GetVarValue('ModTorchLight', 'TLchoice'));    
        if(TLValue = 0) {        

                resourcePath = "dlc\dlcureal\data\items\usable\torch\torch.w2ent";
                entityTemplate = (CEntityTemplate)LoadResource(resourcePath,true);                 
            }
        if(TLValue = 1) {        

                resourcePath = "dlc\dlcureal\data\items\usable\torch\torch1.w2ent";
                entityTemplate = (CEntityTemplate)LoadResource(resourcePath,true);                      
            }
        if(TLValue = 2) {        

                resourcePath = "dlc\dlcureal\data\items\usable\torch\torch2.w2ent";
                entityTemplate = (CEntityTemplate)LoadResource(resourcePath,true);                      
            }
        if(TLValue = 3) {        

                resourcePath = "dlc\dlcureal\data\items\usable\torch\torch3.w2ent";
                entityTemplate = (CEntityTemplate)LoadResource(resourcePath,true);                      
            }            


        //check if used by the Player and that fact does not exist, then proceed with instantiating the entity    
        if(usedBy == thePlayer && !FactsDoesExist("tlmod_used"))

            //check if entity is already active (instantiated) then, if already instantiated (active), set active to false and proceed with destroying entity
            if(active) {

                active = false;                
            }
            //entity is instatiated
            active = true;

            //add facts (set in kngwisp.w2ent) factAddedOnUse = kngwisp_used, factValue = 1, factTimeValid = -1
            FactsAdd(factAddedOnUse, factValue, factTimeValid);

            //instantiate entity from entityTemplate
            entity = (CTorchLight)theGame.CreateEntity(entityTemplate, thePlayer.GetWorldPosition() + Vector(0,0,2), thePlayer.GetWorldRotation());

            //fail-safe, add a tag to the entity this should also be received from the .w2ent, but CDPR
            entity.AddTag('tlmod');

        }
//        else if (!active) {

//            FactsRemove(factAddedOnUse);
//            entity = theGame.GetEntityByTag('tlmod');
//            entity.RemoveTimer('FollowPlayer');
//            entity.StopAllEffects();
//            entity.DestroyAfter(0.1);
//    }
}
 
Make sure the path where your templates are saved is set up as entity template mounter path.

This can be done in a reddlc file (CR4DefinitionsEntitieTemplatesDLCMounter) or if you intend to make a dependency on the bootstrap mod just put your templates into a subdirectory of dlc/modtemplates for example:

dlc/modtemplates/dlcureal/
 
This:


I understand that I will have to make two adaptations,one for the TorchLight mod and one for bootstrap include with Uphenix
 
Last edited:
Ok now i use this in Script game for testing: itemEntity.ws

Code:
//class W3LightSource extends W3UsableItem
//{
//    var worldName : String;

//    event OnUsed( usedBy : CEntity )
//    {
//        blockedActions.PushBack( EIAB_HeavyAttacks );
//        blockedActions.PushBack( EIAB_SpecialAttackHeavy );

//        super.OnUsed( usedBy );

//        worldName =  theGame.GetWorld().GetDepotPath();
//        if( StrFindFirst( worldName, "bob" ) < 0 )
//        {
//            this.PlayEffect( 'light_on' );
//        }
//        else
//        {
//            this.PlayEffect( 'light_on_bob' );
//        }

//        if( usedBy == thePlayer )
//        {
//            thePlayer.UnblockAction( EIAB_Signs, 'UsableItem' );
//            thePlayer.UnblockAction( EIAB_Parry, 'UsableItem' );
//            thePlayer.UnblockAction( EIAB_Counter, 'UsableItem' );
//            thePlayer.AddTag( theGame.params.TAG_OPEN_FIRE );
//        }
//    }

//    event OnHidden( usedBy : CEntity )
//    {
//        if( usedBy == thePlayer )
//        {
//            thePlayer.RemoveTag( theGame.params.TAG_OPEN_FIRE );
//        }

//        super.OnHidden ( usedBy );
//        this.StopEffect( 'light_on' );    
//        this.StopEffect( 'light_on_bob' );    
//    }
//}

with my xml for GUI

Code:
&lt;?xml version="1.0" encoding="UTF-16"?&gt;
&lt;UserConfig&gt;
    &lt;Group id="ModTorchLight" displayName="Mods.ModTorchLight" &gt;
        &lt;VisibleVars&gt;
            &lt;Var id="ModEnabled" displayName="ModEnabled" displayType="TOGGLE"/&gt;        
            &lt;Var id="TLchoice"     displayName="option_TLchoice"     displayType="OPTIONS" tags="customNames;customDisplayName"&gt;
            &lt;OptionsArray&gt;
                    &lt;Option id="0" displayName="TLHC"&gt;  
                        &lt;Entry varId="TLchoice" value="0"/&gt;  
                    &lt;/Option&gt;
                    &lt;Option id="1" displayName="TLDark"&gt;
                        &lt;Entry varId="TLchoice" value="1"/&gt;
                    &lt;/Option&gt;
                    &lt;Option id="2" displayName="TLRealistic"&gt;
                        &lt;Entry varId="TLchoice" value="2"/&gt;
                    &lt;/Option&gt;
                    &lt;Option id="3" displayName="TLBrightness"&gt;
                        &lt;Entry varId="TLchoice" value="3"/&gt;
                    &lt;/Option&gt;                
            &lt;/OptionsArray&gt;
            &lt;/Var&gt;    
        &lt;/VisibleVars&gt;
    &lt;/Group&gt;    
&lt;/UserConfig&gt;

Then uncook FloatingTorch end edit xml for animation UI_Bell for UI_Torch
i copy and past FloatingTorch for create FloatingTorch1,FloatingTorch2,FloatingTorch3 in DLC folder
i cooked DlC and install it in my DLC folder.

now for edit Script FloatingTorch : this Script is buggy:

Code:
statemachine class CFloatingTorch extends W3UsableItem {


    private var boneRot                                                     : EulerAngles; //FloatingTorchCurrentRotation
    private var Position                                                     : Vector;
//    private var FloatingTorchGoalPositionOffset                             : Vector;
//   private var FloatingTorchGoalPositionOffset_regenerateInSeconds         : float;
//    private var FloatingTorchCurrentRotationCircleAngle                     : float;
//    private var pos cameraDir, player, posFin                                 : Vector;
//    private var FloatingTorchCurrentVelocity                                 : Vector;
//    private var FloatingTorchCurrentAcceleration                             : Vector;
    private var inGameConfigWrapper                                            : CInGameConfigWrapper;
    private var active                                                       : bool;
    private var resourcePath                                                 : string;
    private var entityTemplate                                                 : CEntityTemplate;
    var TLValue                                                               : int;
    var worldName                                                             : String;
     var bonePosition, pos                                                     : Vector;    
    private var entity                                                        : CEntity;
    editable var factAddedOnUse                                              : string;
    editable var factValue                                                    : int;
    editable var removeFactOnHide                                           : bool;
    editable var factTimeValid                                              : int;  


 //   default itemType = UI_Torch;

    event OnUsed(usedBy : CEntity)

    {

            super.OnUsed(usedBy);

            if(usedBy == thePlayer &amp;&amp; !FactsDoesExist("floatingtorch_used"))
            {
                        if(active) {

                    active = false;                
                }

                //entity is instatiated
                active = true;

                    //add facts (set in floatingtorch.w2ent) factAddedOnUse = floatingtorch_used, factValue = 1, factTimeValid = -1
                    FactsAdd(factAddedOnUse, factValue, factTimeValid);    
                    blockedActions.PushBack( EIAB_HeavyAttacks );
                    blockedActions.PushBack( EIAB_SpecialAttackHeavy );                

                TLValue = StringToInt(inGameConfigWrapper.GetVarValue('ModTorchLight', 'TLchoice'));    
                    if(TLValue == 0) {        

                        resourcePath = "dlc\dlcfloatingtorch\data\w2ent\floatingtorch.w2ent";

                   }
                    if(TLValue == 1) {        

                        resourcePath = "dlc\dlcfloatingtorch\data\w2ent\floatingtorch1.w2ent";


                    }
                    if(TLValue == 2) {        

                         resourcePath = "dlc\dlcfloatingtorch\data\w2ent\floatingtorch2.w2ent";


                    }
                    if(TLValue == 3) {        

                  resourcePath = "dlc\dlcfloatingtorch\data\w2ent\floatingtorch3.w2ent";                      

                     }            

                    entityTemplate = (CEntityTemplate)LoadResource(resourcePath,true);

                    boneRot = GetWorldRotation();

                    Position = thePlayer.GetWorldPosition();            

//                worldName =  theGame.GetWorld().GetDepotPath();

                entity = (CFloatingTorch)theGame.CreateEntity(entityTemplate, Position, boneRot);    
                entity.AddTag('floatingtorch');    

            }    
//            if( StrFindFirst( worldName, "bob" ) &lt; 0 )    
//            {
//                this.PlayEffect( 'light_on' );

//            }

//            else
//            {
                // this.PlayEffect( 'light_on_bob' );
//                this.PlayEffect( 'light_on' );

//            }
            if( usedBy == thePlayer )
            {
                entity.CreateAttachmentAtBoneWS( thePlayer, 'l_hand',GetWorldPosition(), GetWorldRotation());    
                thePlayer.UnblockAction( EIAB_Signs, 'UsableItem' );
                thePlayer.UnblockAction( EIAB_Parry, 'UsableItem' );
                thePlayer.UnblockAction( EIAB_Counter, 'UsableItem' );
                thePlayer.AddTag( theGame.params.TAG_OPEN_FIRE );
                this.PlayEffect( 'light_on' );                
            }

    }
    event OnHidden( usedBy : CEntity )
    {
        super.OnHidden ( usedBy );
        FactsRemove(factAddedOnUse);
        entity = theGame.GetEntityByTag('floatingtorch');
        this.StopEffect( 'light_on' );    
        this.StopEffect( 'light_on_bob' );
        entity.DestroyAfter(0.1);
    }

}


Original Stream Log

Type animation

Modding documentation





 
Last edited:
edit xml FloatingTorch in dlc folder Cooked\dlc\dlcfloatingtorch\data\gameplay\items + \items_plus

this is original xml
Code:
&lt;?xml version="1.0" encoding="UTF-16"?&gt;
&lt;redxml&gt;
&lt;definitions&gt;

&lt;items&gt;

    &lt;!-- ##################################################################################################### --&gt;

    &lt;item     name="floatingtorch"
            category="usable"
            price = "420"
            weight ="0.1"
            equip_slot="l_hand"
            stackable="1"
            grid_size = "1"
            hold_slot=""
            equip_template="floatingtorch"
            hold_template="floatingtorch"

            icon_path="icons/inventory/quests/torch.png"
            localisation_key_name = "item_name_floatingtorch"
            localisation_key_description = "item_desc_floatingtorch" &gt;
        &lt;tags&gt;QuickSlot, UI_Bell&lt;/tags&gt;
        &lt;anim_actions&gt;
            &lt;action
                name="holster"
                event="ItemUseL"
                act="hide_item_act"
                deact="hide_item_deact"&gt;
            &lt;/action&gt;
        &lt;/anim_actions&gt;
    &lt;/item&gt;

&lt;/items&gt;

&lt;/definitions&gt;
&lt;/redxml&gt;

this is original in game xml files in Uncooked\gameplay\items

Code:
    &lt;item     name="Torch"
            category="usable"
            price = "5"
            weight ="0.5"
            equip_slot=""
            stackable="100"
            grid_size = "1"
            hold_slot="l_weapon"
            equip_template="torch"
            hold_template="torch"

            icon_path="icons\inventory\quests\torch.png"
            localisation_key_name = "item_name_torch"
            localisation_key_description = "item_desc_q203_torch" &gt;
        &lt;tags&gt;QuickSlot, mod_junk, UI_Torch&lt;/tags&gt;
        &lt;anim_actions&gt;
            &lt;action
                name="holster"
                event="ItemUse"
                act="hide_item_act"
                deact="hide_item_deact"&gt;
            &lt;/action&gt;
        &lt;/anim_actions&gt;
    &lt;/item&gt;

this is new files fir my mod:

Code:
&lt;?xml version="1.0" encoding="UTF-16"?&gt;
&lt;redxml&gt;
&lt;definitions&gt;

&lt;items&gt;

    &lt;!-- ##################################################################################################### --&gt;

    &lt;item     name="floatingtorch"
            category="usable"
            price = "420"
            weight ="0.1"
            equip_slot=""
            stackable="1"
            grid_size = "1"
            hold_slot="l_weapon"
            equip_template="floatingtorch"
            hold_template="floatingtorch"

            icon_path="icons/inventory/quests/torch.png"
            localisation_key_name = "item_name_floatingtorch"
            localisation_key_description = "item_desc_floatingtorch" &gt;
        &lt;tags&gt;QuickSlot, UI_Torch&lt;/tags&gt;
        &lt;anim_actions&gt;
            &lt;action
                name="holster"
                event="ItemUse"
                act="hide_item_act"
            deact="hide_item_deact"&gt;
            &lt;/action&gt;
        &lt;/anim_actions&gt;
    &lt;/item&gt;

&lt;/items&gt;

&lt;/definitions&gt;
&lt;/redxml&gt;

then new script for mod work with player, but If TLVavue not active and not work.:

Code:
statemachine class CFloatingTorch extends W3UsableItem

//statemachine class CTorchLight extends W3UsableItem
{

//    default id = 'TorchLight';
//    default modAuthor = "jack3459";
//    default modUrl = "http://www.nexusmods.com/witcher3/mods/????/";
 //   default modVersion = '2.0';

//    default logLevel = MLOG_DEBUG;    

    var itemEntity : W3UsableItem;    
    private var inGameConfigWrapper                                        : CInGameConfigWrapper;
    private var active                                                   : bool;
    private var resourcePath                                             : string;
    private var entityTemplate                                            : CEntityTemplate;
    private var TLValue                                                   : int;
    private var entity                                                    : CEntity;

    editable var factAddedOnUse                                         : string;
    editable var factValue                                                : int;
    editable var factTimeValid                                              : int;      

    event OnUsed(usedBy : CEntity)
    {
        super.OnUsed(usedBy);


        blockedActions.PushBack( EIAB_HeavyAttacks );
        blockedActions.PushBack( EIAB_SpecialAttackHeavy );        


        TLValue = StringToInt(inGameConfigWrapper.GetVarValue('ModTorchLight', 'TLchoice'));

//        if (TLValue == 0)
//        {
//            resourcePath = "dlc\dlcureal\data\items\usable\torch\torch.w2ent";

//        }
//        if (TLValue == 1)
//        { //*red*
            resourcePath = "dlc\dlcureal\data\items\usable\torch\torch1.w2ent";

//        }
//        if (TLValue == 2)
//        { //*green*
            resourcePath = "dlc\dlcureal\data\items\usable\torch\torch2.w2ent";

//        }
//        if(TLValue == 3)
//        {  //*bleu*
            resourcePath = "dlc\dlcureal\data\items\usable\torch\torch3.w2ent";

//        }
        entityTemplate = (CEntityTemplate)LoadResource(resourcePath,true);
        entity = (CFloatingTorch)theGame.CreateEntity(entityTemplate, GetWorldPosition(), GetWorldRotation());  

        if(usedBy == thePlayer && !FactsDoesExist("floatingtorch_used"))        

        {    
            FactsAdd(factAddedOnUse, factValue, factTimeValid);


            PlayEffect('light_on');                

            thePlayer.UnblockAction( EIAB_Signs, 'UsableItem' );
            thePlayer.UnblockAction( EIAB_Parry, 'UsableItem' );
            thePlayer.UnblockAction( EIAB_Counter, 'UsableItem' );                            
            thePlayer.AddTag( theGame.params.TAG_OPEN_FIRE );            
        } 
    }           

    event OnHidden( usedBy : CEntity )
    {
        if( usedBy == thePlayer )
        {            

            thePlayer.RemoveTag( theGame.params.TAG_OPEN_FIRE );

        }    
        super.OnHidden ( usedBy );


            StopEffect( 'light_on' );
            FactsRemove(factAddedOnUse);

    }
}
 
Now it Work , yes

Code:
statemachine class CFloatingTorch extends W3UsableItem
//statemachine class CTorchLight extends W3UsableItem
{

//    default id = 'TorchLight';
//    default modAuthor = "jack3459";
//    default modUrl = "http://www.nexusmods.com/witcher3/mods/????/";
 //   default modVersion = '2.0';

//    default logLevel = MLOG_DEBUG;    

//    protected var currentlyUsedItem : W3UsableItem;    
//    private var inGameConfigWrapper        : CInGameConfigWrapper;
//    private var active                       : bool;
//    private var resourcePath                 : string;


    private var entity                        : CEntity;
    private var itplayer                     : float;
    private var resourcePath                : string;
    private var TLValue                     : float;
    var inGameConfigWrapper                 : CInGameConfigWrapper;
    private var entityTemplate                : CEntityTemplate;        

    event OnUsed(usedBy : CEntity)
    {
        if(usedBy == thePlayer && !FactsDoesExist("floatingtorch_used"))    
        {
        inGameConfigWrapper = (CInGameConfigWrapper)theGame.GetInGameConfigWrapper();
        TLValue = StringToFloat(inGameConfigWrapper.GetVarValue('ModTorchLight', 'TLchoice'));
            if (TLValue == 0)
            {
                resourcePath = "dlc\dlcfloatingtorch\data\w2ent\floatingtorch.w2ent";
                theGame.GetGuiManager().ShowNotification("tlm " + TLValue);

            }
            else if(TLValue == 1)
            {
                resourcePath = "dlc\dlcfloatingtorch\data\w2ent\floatingtorch1.w2ent";
                theGame.GetGuiManager().ShowNotification("tlm 1" + TLValue);

            }
            else if(TLValue == 2)
            { //*vert
                resourcePath = "dlc\dlcfloatingtorch\data\w2ent\floatingtorch2.w2ent";
                theGame.GetGuiManager().ShowNotification("tlm 2" + TLValue);

            }
            else if(TLValue == 3)
            {  
                resourcePath = "dlc\dlcfloatingtorch\data\w2ent\floatingtorch3.w2ent";
                theGame.GetGuiManager().ShowNotification("tlm 3" + TLValue);

            }

        entityTemplate = (CEntityTemplate)LoadResource(resourcePath,true);
        entity = (CFloatingTorch)theGame.CreateEntity(entityTemplate, GetWorldPosition(), GetWorldRotation());
//        entity.AddTag('floatingtorch');        
        entity.CreateAttachment(thePlayer, 'l_weapon', /* NO P */, /* NOP */);
        super.OnUsed(entity);
        entity.PlayEffect('light_on');
        blockedActions.PushBack( EIAB_HeavyAttacks );
        blockedActions.PushBack( EIAB_SpecialAttackHeavy );    
        thePlayer.UnblockAction( EIAB_Signs, 'UsableItem' );
        thePlayer.UnblockAction( EIAB_Parry, 'UsableItem' );
        thePlayer.UnblockAction( EIAB_Counter, 'UsableItem' );                            
        thePlayer.AddTag( theGame.params.TAG_OPEN_FIRE );            
        }          
    }


    event OnHidden( usedBy : CEntity )
    {
        if( usedBy == thePlayer )
        {            

            thePlayer.RemoveTag( theGame.params.TAG_OPEN_FIRE );

        }    
        super.OnHidden ( usedBy );

            entity.DestroyAfter(0.2);
            entity.StopEffect( 'light_on' );

    }
}

 
Aio TorchLight With GUI Menu DLC mod

Menu:

Code:
<?xml version="1.0" encoding="UTF-16"?>
<UserConfig>
    <Group id="ModTorchLight" displayName="Mods.ModTorchLight" >
        <VisibleVars>                    
            <Var id="TLchoice"     displayName="option_TLchoice"     displayType="OPTIONS" tags="customNames;customDisplayName">
            <OptionsArray>
                    <Option id="0" displayName="TLHC">  
                        <Entry varId="TLchoice" value="0"/>  
                    </Option>
                    <Option id="1" displayName="TLDark">
                        <Entry varId="TLchoice" value="1"/>
                    </Option>
                    <Option id="2" displayName="TLRealistic">
                        <Entry varId="TLchoice" value="2"/>
                    </Option>
                    <Option id="3" displayName="TLBrightness">
                        <Entry varId="TLchoice" value="3"/>
                    </Option>                
            </OptionsArray>
            </Var>    
        </VisibleVars>
    </Group>    
</UserConfig>

Script :

Code:
statemachine class CTorchLight extends W3UsableItem
{

//    default id = 'TorchLight';
//    default modAuthor = "jack3459";
//    default modUrl = "http://www.nexusmods.com/witcher3/mods/????/";
//    default modVersion = '5.0';

    private var entity                        : CEntity;

    private var resourcePath                : string;
    private var TLValue                     : float;
    var inGameConfigWrapper                 : CInGameConfigWrapper;
    private var entityTemplate                : CEntityTemplate;        

    event OnUsed(usedBy : CEntity)
    {
        if(usedBy == thePlayer && !FactsDoesExist("tlmod_used"))    
        {
        inGameConfigWrapper = (CInGameConfigWrapper)theGame.GetInGameConfigWrapper();
        TLValue = StringToFloat(inGameConfigWrapper.GetVarValue('ModTorchLight', 'TLchoice'));
            if (TLValue == 0)
            {
                resourcePath = "dlc\dlctorchlight\data\w2ent\torchlight.w2ent";
                theGame.GetGuiManager().ShowNotification("tlm " + TLValue);

            }
            else if(TLValue == 1)
            {
                resourcePath = "dlc\dlctorchlight\data\w2ent\torchlight1.w2ent";
                theGame.GetGuiManager().ShowNotification("tlm 1" + TLValue);

            }
            else if(TLValue == 2)
            {
                resourcePath = "dlc\dlctorchlight\data\w2ent\torchlight2.w2ent";
                theGame.GetGuiManager().ShowNotification("tlm 2" + TLValue);

            }
            else if(TLValue == 3)
            {  
                resourcePath = "dlc\dlctorchlight\data\w2ent\torchlight3.w2ent";
                theGame.GetGuiManager().ShowNotification("tlm 3" + TLValue);

            }

        entityTemplate = (CEntityTemplate)LoadResource(resourcePath,true);
        entity = (CTorchLight)theGame.CreateEntity(entityTemplate, GetWorldPosition(), GetWorldRotation());        
        entity.CreateAttachment(thePlayer, 'l_weapon', /* NO P */, /* NOP */);
        super.OnUsed(entity);
        entity.PlayEffect('light_on');
        blockedActions.PushBack( EIAB_HeavyAttacks );
        blockedActions.PushBack( EIAB_SpecialAttackHeavy );    
        thePlayer.UnblockAction( EIAB_Signs, 'UsableItem' );
        thePlayer.UnblockAction( EIAB_Parry, 'UsableItem' );
        thePlayer.UnblockAction( EIAB_Counter, 'UsableItem' );                            
        thePlayer.AddTag( theGame.params.TAG_OPEN_FIRE );            
        }          
    }


    event OnHidden( usedBy : CEntity )
    {
        if( usedBy == thePlayer )
        {            

            thePlayer.RemoveTag( theGame.params.TAG_OPEN_FIRE );

        }    
        super.OnHidden ( usedBy );

            entity.DestroyAfter(0.2);
            entity.StopEffect( 'light_on' );

    }
}

String

Code:
2112810100||Mods;
2112810101||TorchLight
2112810102||Choice
2112810103||TLHC Immersion
2112810104||Vanilla
2112810105||Dark
2112810106||Realistic
2112810107||Brightness
2112810108||Mod Enabled

 
Top Bottom