Modme Forums

how to move a trigger_hurt

Game Modding | Call of Duty: Black Ops 3 | Scripting


ModmeBot:

Thread By: KillJoyYT
I'm not sure how to move a trig_hurt in my script I thought this would work but when I load in game only the model moves :(



function shoot_trig_damage_2()
{
    trig_damage_2 = GetEnt("trig_damage_2", "targetname");
    trig_hurt_2 = GetEnt("trig_hurt_2", "targetname");

    model_damage_2 = GetEnt("model_damage_2", "targetname");
 
    trig_damage_2 SetHintString("Locked");
    trig_damage_2 SetCursorHint("HINT_NOICON");

    {
        trig_damage_2 waittill("damage");
         trig_hurt_2 MoveX(90,4);
        trig_damage_2 Delete();
       model_damage_2 MoveX(90,4);
    }
}





am I doing something wrong? thank you


ModmeBot:

Reply By: Harry Bo21

KillJoyYT
I'm not sure how to move a trig_hurt in my script I thought this would work but when I load in game only the model moves :( function shoot_trig_damage_2() { trig_damage_2 = GetEnt("trig_damage_2", "targetname"); trig_hurt_2 = GetEnt("trig_hurt_2", "targetname"); model_damage_2 = GetEnt("model_damage_2", "targetname"); trig_damage_2 SetHintString("Locked"); trig_damage_2 SetCursorHint("HINT_NOICON"); { trig_damage_2 waittill("damage"); trig_hurt_2 MoveX(90,4); trig_damage_2 Delete(); model_damage_2 MoveX(90,4); } } am I doing something wrong? thank you

you should link the trigger to the model rather than that

entity enableLinkTo();
entity linkTo( other_entity );

also adding


{

}

has done absolutely nothing other than "looking pretty"

in future you should be reading the script API included in the docs with the mod tools. Open it in a internet browser and use the search function to look for stuff


ModmeBot:

Reply By: KillJoyYT
sorry I didn't have the brackets in the first time and kept getting errors trying to link


so I tried something like this but I'm still confused as to where and how I name the entities. also do I have to link the trig hurt to the model in radiant?


function shoot_trig_damage_2()
{
    trig_damage_2 = GetEnt("trig_damage_2", "targetname");
    trig_hurt_2 = GetEnt("trig_hurt_2", "targetname");

    model_damage_2 = GetEnt("model_damage_2", "targetname");
 
    trig_damage_2 SetHintString("Locked");
    trig_damage_2 SetCursorHint("HINT_NOICON");

         Model_damage_2 enableLinkTo();
Model_damage_2 linkTo( trig_hurt_2 );


        trig_damage_2 waittill("damage");
        trig_damage_2 Delete();
       model_damage_2 MoveX(90,4);
    }


also tried putting enablelinkto after the waittill




thanks man


ModmeBot:

Reply By: Harry Bo21

function shoot_trig_damage_2()
{
	trig_hurt_2 = getEnt( "trig_hurt_2", "targetname" );
	trig_hurt_2 enableLinkTo();
	
    trig_damage_2 = getEnt( "trig_damage_2", "targetname" );
	trig_damage_2 setHintString( "Locked" );
    trig_damage_2 setCursorHint( "HINT_NOICON" );
   
    model_damage_2 = getEnt( "model_damage_2", "targetname" );
	model_damage_2 enableLinkTo(); // dont think you need this
	
	trig_hurt_2 linkTo( model_damage_2 );
    
	trig_damage_2 waittill( "damage" );
	
    trig_damage_2 delete();
	
    model_damage_2 moveX( 90,4 );
}

// 1. Format your code properly or its impossible to read properly
// 2. Several mistypes in here eg - Model_damage_2 vs model_damage_2 ( capital M )
// 3. Your moving the model, so you link the trigger "to" the model


ModmeBot:

Reply By: KillJoyYT
i can see clearer now the rain is gone

thank you very much sir!