Jump to content
The Dark Mod Forums

joebarnin

Member
  • Posts

    1085
  • Joined

  • Last visited

  • Days Won

    42

Posts posted by joebarnin

  1. I've got an atdm:ai_elemental, and I want to augment its death behavior. So I implemented a script and set the "death_script" spawnarg to "testDeathScript". Works fine, my death script gets called. But, this bypasses the base death script functionality, which I want to have happen as well. Is there a way to call the base function that I've overridden? I tried a few ways. Among others, I tried:

    void testDeathScript(entity ele)
    {
        ele.onDeath();
    }


    results in ERROR:Error: file maps\rock.script, line 81: Unknown value "onDeath"

    void testDeathScript(entity ele)
    {
        atdm:ai_elemental elemental = ele;
        ele.onDeath();
    }

    results in ERROR:Error: file maps\rock.script, line 81: Unknown value "atdm"
     

    I worked around it by copying the content of the onDeath script into my script. That functions correctly, but it seems like perhaps not the best programming practice. Is there a way to call the 'base' function in this case?

  2. It was happening in one of my missions. I worked around it by adjusting the position of the ai, the chair he was sitting in, and the table he was near, until it didn’t happen anymore. But, since it was an intermittent problem, I was never sure that I actually eliminated the issue. It just never happened again in my testing. 

    • Like 1
  3. I have a trigger_multiple, and I want to be notified whenever the player is within it. The trigger_multiple targets an atdm:target_callscriptfunction. I also set wait=1 on the trigger. When the player is within the trigger area, the script gets called once a second. This happens if the player is moving or stationary. So everything is working great.
     
    I also want to be notified if any other AI is within the trigger area. So I added the anyTouch=1 spawnarg. Now, when a guard walks into the trigger, the script function gets called. As long as he's moving, it gets called (once a second). But as soon as he stops, the script is no longer called (I assume becase the trigger is no longer firing). This is true if he is just standing there, or is stationary because of a path_wait.
     
    Summary: a trigger_multiple will fire each time the player is within the trigger. But a trigger_multiple with anyTouch=1 will only fire for other AIs if the AI is moving. If the AI is stationary, the trigger no longer fires.
     
    Intentional, or bug?
  4. I haven't tried this myself yet, but I found some script code in another project that fades a light from one color to another:

    		// Transition
    		vector delta = col2 - col;
    		float starttime = sys.getTime();
    		float endtime = starttime + fadeSeconds;
    		float nowtime = sys.getTime();
    		while ( nowtime < endtime )
    		{
    			float frac = ( nowtime - starttime ) / fadeSeconds;
    			theLight.setLightParm(0, col_x + (frac * delta_x) );
    			theLight.setLightParm(1, col_y + (frac * delta_y) );
    			theLight.setLightParm(2, col_z + (frac * delta_z) );
    
    			sys.waitFrame();
    			nowtime = sys.getTime();
    		}
    		// Finalize colour
    		theLight.setLightParm(0, col2_x );
    		theLight.setLightParm(1, col2_y );
    		theLight.setLightParm(2, col2_z );
    

    'col2' is the new color, 'col1' is the old one. 'fadeSeconds' is how fast to fade. Give this a try?

    • Like 1
  5. 1 hour ago, MirceaKitsune said:

    What's the entity type for having a model that sways back and forth? I've seen swinging signs above taverns in some FM's but couldn't find the entity for making my own. I believe for constant rotation it's func_rotating but not sure for bobbing.

    func_pendulum IIRC (I don’t have my computer in front of me). Set it up and bind the visible object to it. There’s one in my mission Now and Then

    • Thanks 1
  6. 3 hours ago, datiswous said:

    Do you still have that old unfinished mission somewhere? Or is it recreated into another mission?

    I was going to say 'no', but I decided to hunt around on some old backup disks, and lo and behold, I found the original mission (the beta, not the additional changes). I opened it up in DR, and man is it ugly. Simple, plain, nothing clever or interesting. I can see why the beta testers wanted changes. I'm glad I threw it away and started over. 🙃

  7. I like this feature - especially because it allows you to select and manipulate objects that are in a group, something I just complained about a few days ago. Good timing! I played around with it for a few minutes, didn't see any issues.

    However, I did notice something in this version of DR. The Camera view does not behave as expected. Examples:

    • In Camera view, the ESC key no longer deselects. In ortho views, ESC deselects fine, but in the Camera window, it doesn't do a thing.
    • Undo doesn't seem to redraw in the camera window either. 
    • Selecting an object in ortho view doesn't highlight it in the camera window.

    Are these known issues?

  8. @MirceaKitsune

    Spoiler

    When you say the green elements won't collide, I'm not sure what you mean. Are you saying that when the green elemental hits you, you don't get transported?

    In the previous room, with just the orange and green elementals, did the green ones work?

    Can you send me your qconsole.log file? Here are the instructions:

    Open file darkmod.cfg in text editor.
    Find or create new line containing: seta logFile "1"
    Save the file, start TDM and reproduce the issue.
    Now find the file named qconsole.log in the directory of the currently installed FM, for instance in C:\games\thedarkmod\fms\byanyothername

    Thanks.

     

  9. 1 hour ago, Frost_Salamander said:

    Actually what I really want to do is override the behavior of the atdm:mover_elevator_button entity. My main requirement is actually just to not let the elevator move unless the doors are closed (hence all the auto-closing nonsense).  But pressing that button causes it to move no matter what.  I just checked and it doesn't have a script object.  Is there a way to intercept the call that the button makes and insert custom code there? For example have an 'onPress' event that I could customize before sending it off to do its thing...

    I've seen a technique for doing this, in The Painter's Wife. I borrowed the code myself for a WIP. The technique is basically to override the  multistateposition object (defined in tdm_movers.script) and implement the onMultiStateMoverLeave method, which stops the elevator before it gets going, tries to close the door(s), and then starts up the elevator again. The code is something like this:

    void multistateposition::onMultiStateMoverLeaveEffector(entity mover)
    {
    	door.setFrobable(0);
    
    	if (door.IsOpen())
    	{
    		door.Close();
    		tdm_elevator elev;
    		elev=mover;
    		sys.waitFrame();
    		elev.stopMoving();
    
    		while(door.IsOpen()) 		//wait for door to close
    		{
    			sys.waitFrame();
    		}
    
    		elev.activate(elev.lastTriggeredBy);	//once door has closed, set the elevator in motion once more
    		door.Lock();
    	}
    
    	else
    	{
    		door.Lock();
    	}
    }

    Take a look at that FM to see how it's done.

    • Thanks 1
  10. 4 hours ago, AluminumHaste said:

    Select the group, press TAB to cycle through the items. That's how I always do it.

    You can do the same thing when you convert a bunch of patches/brushes to a func_static.

    Huh. TAB works for me on func_statics that were created from brushes. But it doesn't work for groups. I'm running DR 3.3.0, if that makes a difference. Maybe I'll try an older version.

    Edit: I tried DR 2.11 and that version doesn't work for me either. I verified that my keyboard shortcuts are setup correctly, GroupCycleForward = TAB. @AluminumHaste, is that your setting as well?

  11. DarkRadiant question. How do I select just one item of a group? I have a bunch of entities that are grouped. If I select any of them, it selects them all. But what if I want to select just one (in this case, to change its spawnargs)? Sure, I can ungroup, select the object, then regroup, but I'm hoping there's something more efficient.

  12. I've whitelisted it, and I still get those errors. 

    Originally, the AV program reported this: "The file E:\games\DarkRadiant\modules\sound.dll is infected with Gen:Variant.Tedy.207462 and was moved to quarantine. It is recommended that you run a System Scan to make sure your system is clean."

    However, I just downloaded the DarkRadiant source from GitHub, and rebuilt sound.dll using VisualStudio. When I use the rebuilt sound.dll, I no longer get the error.

    So, problem solved. It must have been related to the antivirus.

     

  13. When starting up DR, I get these errors in darkradiant.log:

    LoadLibrary failed: 'E:/games/DarkRadiant33/modules/sound.dll'
    GetLastError: The specified module could not be found.
    WARNING: Failed to load module E:/games/DarkRadiant33/modules/sound.dll:

    This could be just me, since I was having problems with my antivirus and that DLL. Can someone else running DR 3.3.0 check their log and see if they have that error? Thanks.
     

  14. 18 minutes ago, CrisiusXIII said:

    btw, is it possible to have a kind off afterglow with the correct tiles when failing? then its more clear what went wrong. the 3D changings are a bit difficult aswell since the tiles close to the door are rather small before aproaching.

    i dont know how to make a gameplay, is that a function or should i install a desktop-recorder ??

    If I do another update to this mission, I'll add this suggestion.

    There is no built-in function in TDM to record game play. You'll have to use a 3rd party recorder. Or, F12 (on the PC) does a screenshot, which might be enough to help me figure out what is happening. Next time you fail, don't move, look down, and take a screenshot with F12. You should see the tile looking down - you don't even have to be right in the middle of the tile.

  15. 15 hours ago, CrisiusXIII said:

    Hi

    I enjoy it, still playing but i had to comment on a thing


     

      Hide contents

    i missed severall attempts on the tile floor becouse the positioning off the 'not' visible person is difficult and against to so normal "gliding into impossible places" which is sometimes to easy aswell.. but now i have to look down and stand exactly lined out on a tile else it wont work, i have had some MANY burpsounds while realy being ON that tile that it realy gets me off by now . i avoid (f9)  LONG steps since then i am 100% sure i wil have the correct sequence but STEP JUST A PIXEL BESIDE

    thats the not so very fun part. now i get stuck on 5. i bumped most guards, piled them up in a corner, found 2 secrets and the window, and if i had a single lose dime

    i would give it to that bagger, or the BIGGEST piece off cheese available, 'party'

    Glad you're enjoying the mission. I'm surprised

    Spoiler

    that you're having problems positioning on the tiles with the glyphs (I think that's the room you're talking about?). I designed it with lots of room for error. You shouldn't have to be in an exact location. I wonder why it is not working well for you? If you don't mind, could you send a gameplay video of this problem?

    As for the beggar

    Spoiler

    there is something you can give him to make him happy. A special coin. Look

    Spoiler

    on a window sill on the outside of the tavern. 

     

     

×
×
  • Create New...