Jump to content
The Dark Mod Forums

Recommended Posts

Posted

If I change a shaderparm on an AI in a script using $BennyGuard.setShaderParm( parmno, newval), how do I get that to propagate through to the AI's head and weapon entities?

My missions:      Stand-alone                                                  Duncan Lynch series           Collabs                             

                                 Down and Out on Newford Road          the Factory Heist                  A Collector's Errand (with Bikerdude)

                           The Wizard's Treasure                          A House Call

                                                                                           The House of deLisle                                                                                                  

                              

Posted
6 hours ago, thebigh said:

If I change a shaderparm on an AI in a script using $BennyGuard.setShaderParm( parmno, newval), how do I get that to propagate through to the AI's head and weapon entities?

Maybe call $BennyGuard.getAttachmentInd() with incrementing values on the id (starting with 0), to get all the attached entities, and call setShaderParm on each of them. 

  • Like 1
Posted

Hmm, I can't seem to make any changes whatsoever to attached entities, either using this method or using getHead() and getWeaponEntity(). setShaderParm() does nothing. Not even remove() or unbind() have any effect. It doesn't seem possible to cause any changes at all to an attached entity. Oh well, so much for that mission concept, LOL.

My missions:      Stand-alone                                                  Duncan Lynch series           Collabs                             

                                 Down and Out on Newford Road          the Factory Heist                  A Collector's Errand (with Bikerdude)

                           The Wizard's Treasure                          A House Call

                                                                                           The House of deLisle                                                                                                  

                              

Posted

I'm trying to get burn-away to work like it did in Doom3. Basically, I've given Benny a skin that's his usual outfit but with an irregular, clumpy alpha channel over the top of it. I also made similar skins for his head and sword. These have things like

{
	    blend diffusemap 
	    map models/md5/chars/benny/benny_body_d
	    alphatest parm3
	}

in the material definition so that by varying shaderParm3 in-game I can get Benny to look like he's dissolving into clumps of ash, like the imps did in Doom3 when you killed them. Works perfectly for all the materials on his body, but not his head or weapon.

void alphadjust( float x ) {
    entity Sword = $Benny.getWeaponEntity();
    entity Head = $Benny.getHead();    
    $Benny.setShaderParm( 3, x );             //works perfectly
    
    $Sword.setShaderParm( 3, x );             //does nothing    
    $Head.setShaderParm( 3, x );              //does nothing    

    $Sword.remove();             //does nothing    
    $Sword.unbind();             //does nothing    


    return;
}

 

My missions:      Stand-alone                                                  Duncan Lynch series           Collabs                             

                                 Down and Out on Newford Road          the Factory Heist                  A Collector's Errand (with Bikerdude)

                           The Wizard's Treasure                          A House Call

                                                                                           The House of deLisle                                                                                                  

                              

Posted

Cool idea! The fact that remove() doesn’t work either makes me think that the getWeaponEntity call isn’t returning the correct object. I’ll do some experimenting when I get home later in the week.

  • Like 1
Posted (edited)

Okay, I've been playing around with this a bit and it looks like getHead() and getWeaponEntity() are not returning what I expect. If I go in-game and enter ListEntities in the console, I find out that Benny's head and sword are called Benny_head and CMeleeWeapon_atdm:moveable_longsword_9 respectively.

 

void alphadjust( float x ) {
    entity Sword = $Benny.getWeaponEntity();  //what does this actually return?
    entity Head = $Benny.getHead();           //what does this actually return?

    $Benny.setShaderParm( 3, x );             //works perfectly
    
    $Sword.setShaderParm( 3, x );             //does nothing    
    $Head.setShaderParm( 3, x );              //does nothing    

    $Benny_head.setShaderParm( 3, x );        //works perfectly
    
    //$CMeleeWeapon_atdm:moveable_longsword_9.setShaderParm( 3, x );    //won't work because variable names can't contain a colon


    return;
}

 

And in any case I'd prefer not to have to rely on knowing beforehand what the name of the entity is going to be, because later versions of TDM might change it and break my mission; and names containing an entity ID number definitely will change during mapping.

Edited by thebigh

My missions:      Stand-alone                                                  Duncan Lynch series           Collabs                             

                                 Down and Out on Newford Road          the Factory Heist                  A Collector's Errand (with Bikerdude)

                           The Wizard's Treasure                          A House Call

                                                                                           The House of deLisle                                                                                                  

                              

Posted (edited)

@thebigh
 

void test() {
	$Benny_head.hide();

entity child;
float i;

for (i = 0; i < 10; i++) {
    child = $Benny.getBindChild(i);
    
    string class = child.getKey("spawnclass");
        
        if (child.getKey("spawnclass") == "CMeleeWeapon") {
        child.hide(); //child.setShaderParm( 3, x );        
        }
    }
}

Maybe that will always work?
(The Sword is BindChild 0 when sheathed and becomes 1 when drawn it seems)
 

Edited by STRUNK
  • Like 1
  • Thanks 1
Posted

Yep, this works! 

  • Like 1

My missions:      Stand-alone                                                  Duncan Lynch series           Collabs                             

                                 Down and Out on Newford Road          the Factory Heist                  A Collector's Errand (with Bikerdude)

                           The Wizard's Treasure                          A House Call

                                                                                           The House of deLisle                                                                                                  

                              

Posted
45 minutes ago, joebarnin said:

Looking forward to seeing what this looks like!

 

I'm hoping to get the mission done before the end of the year. The map itself is unlikely to be too big, but there's a lot more fiddling with material defs and scripting than I anticipated. 

  • Like 3

My missions:      Stand-alone                                                  Duncan Lynch series           Collabs                             

                                 Down and Out on Newford Road          the Factory Heist                  A Collector's Errand (with Bikerdude)

                           The Wizard's Treasure                          A House Call

                                                                                           The House of deLisle                                                                                                  

                              

Posted

Can't the decal be applied to the “mover_door” or “mover_door_sliding” class? 

2027/28 (Possibly prepping)

subpx.png.f5f46728702be3eaa0cd8d5101c2c14a.png

taffer sandwich and 1 layer cake , a nice bollen cake , four pulpy and squishy croquettes , baked potato and a cup of medium-roasted java preanger,bajawa,  panama or peruvian geisha or gayo coffee

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recent Status Updates

    • Ansome

      Terribly difficult juggling map designing with work, but I'm still alive and chipping away at something very special. I'm actually making a collaboration of sorts with a friend, I make the map itself and he acts as my "Chief Scope Creep Consultant" that checks in every so often to make sure this project isn't getting out of hand. It's a good system!
      · 0 replies
    • JackFarmer

      We don't need artificial intelligence; we need artistic intelligence. 
      Ralf Hütter, Kraftwerk
      · 5 replies
    • taaaki

      The post editor for the dark themes should be working again. Apologies for the inconvenience.
      · 1 reply
    • jaxa

      Talk GabeCube:
      https://forums.thedarkmod.com/index.php?/topic/18055-2016-cpugpu-news/page/39/#findComment-508710
      · 3 replies
    • The Black Arrow

      Things have been so bad these days for me...
      Just a year ago, I've been feeling dizzy, I thought it was nothing, today's stress, that type of thing, went to sleep...Still dizzy! 9 more days dizzy, went to doctor (I would have gone on the first day if NOT for the long appointment time)
      Said it may be Neck Dizziness...I did exercises for 6 months, no changes.
      Went to a Physical Therapist, went to another, no changes.
      I've asked my doctor for a full check this time.
      I hated yesteryear so much due to personal reasons, this year might be the same.
      To be brutally honest, I'd rather have cancer or/and chronic pain than suffer dizziness any second longer, especially when nothing helps.
      Hard to enjoy Thief when you're dizzy so I was hoping this year, Winter will be best for me.
      · 7 replies
×
×
  • Create New...