Modme

New Modme platform coming soon!
how to move a trigger_hurt
Viewed 68 time(s)
Topic created on 1518582111
Original post
Modme User
1 wins

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

 

Reply #1 on 1518589240
Modme User
120 wins

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


HarryBo21's BO3 Perks v2.1.1
LINK TO MODME POST
HarryBo21's WAW Perks v5.2.0
LINK TO MODME POST
Black Ops 3 Gun Pack v2.3.0
LINK TO MODME POST
Black Ops 3 Napalm Zombie v3.0.1
LINK TO MODME POST
Black Ops 3 Shrieker Zombie v3.0.1
LINK TO MODME POST
Reply #2 on 1518594028
Modme User
1 wins

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

 

 

 

Reply #3 on 1518599432
Modme User
120 wins
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

HarryBo21's BO3 Perks v2.1.1
LINK TO MODME POST
HarryBo21's WAW Perks v5.2.0
LINK TO MODME POST
Black Ops 3 Gun Pack v2.3.0
LINK TO MODME POST
Black Ops 3 Napalm Zombie v3.0.1
LINK TO MODME POST
Black Ops 3 Shrieker Zombie v3.0.1
LINK TO MODME POST
Reply #4 on 1518658270
Modme User
1 wins

i can see clearer now the rain is gone

 

thank you very much sir!