Jump to content
The Dark Mod Forums

STRUNK

Member
  • Posts

    479
  • Joined

  • Last visited

  • Days Won

    14

Posts posted by STRUNK

  1. @MirceaKitsune

    I tried the set model s/r and I kept getting black boxes so I tried "remove" and "spawn entity" and that works.

    Select the entity tht must change upon a trigger from the objective and give it trigger as stim and trigger as response, then add effect remove, and select the object that you are setting the s/r on, and then add an other effect spawn entity. There you set the entity that it must become, and fill in the origin. For the origin just place th entity in the right place and copy the coördinates.

  2. So far the fire fly is working fine, but I'd like to have it do some thing's that it doesn't do now:

    It should flee .. health = 5 health_critical = 30 .. but it doesn't flee. [Also I would like it to travel up and down more.=solved]  And it would be nice if it could start sitting or sleeping and only start moving when it's alerted.

    • Like 1
  3. I made the trigger_poltergeist : O

    It was an idea and a little script from @MirceaKitsune and I turned into a trigger. Only thing is the stim response workaround and I would like to give the script an other name then tdm_reuseable_script .. but I had no success with that at the start, and didn't try anymore. Can some of you maybe test it and/or optimise the script, if needed?

    Here is the .def .script and a custom .prt

    tdm_fire_torch_small_blue.prtcustom_trigger.deftdm_reusable_script.scripttdm_custom_scripts.script

    .script(s) go into your script folder, .def goes in your def folder and .prt goes in your particles folder. If you don't have these folders, create them : )

     

     

  4. Ok, I got it now. The "name" I give it in my script is only a reference so I don't have to worry about spawned objects getting the same name.

        entity light = sys.spawn("light");
        light.setColor(color_x, color_y, color_z);
        light.setOrigin(obj.getOrigin());
        light.setRadius(80);
        light.bind(obj);

    string myStr = light.getName();
    sys.println(myStr);

    I get a something like idLight_light_54 .. so that's already taken care of by the main script : )

  5. @Obsttorte

    Ok thanx, did that, now I want to look if it works/print the new name. But this doesn't work:

        entity light = sys.spawn("light");
        light.setName(getName());

    sys.println(light);

    An other thing, it's also spawning a trigger hurt and I want mappers to give it a hurt value from the triggers spawnargs, only the value must be "damage_triggerhurt_x" (where x is a number) for the trigger_hurt to understand it, and I want mappers to only fill in the number, so I have to combine the key value (0 to 1000) with "trigger_hurt_" and make that into one variable/string. How to do that?

  6. I want to give a spawned object the name of the trigger I'm making + something, to make it unique.

    The name of the trigger is "trigger_poltergeist_1" and the name of the spawned object should be "trigger_polergeist_1_light". So when I have more then one of these triggers it would be "trigger_poltergeist_2_light" etc.

    How can I do that?

  7. @Dragofer

    It works now I copied things from the custom_func.def. This is really very strange as when I look to the .defs for @VanishedOne's triggers, they are set up as what I had .. and they do work. Maybe it's only buggy in the reuseable script. I also tried to give my script an other name, but that didn't work either .. although the wiki says it should work ... see "Discovery (or, why is TDM ignoring my script file?)" https://wiki.thedarkmod.com/index.php?title=Scripting_basics

    Is that also a bug, or did I just do something wrong and should it work?

  8. For hours now I'm trying to find out how to get a predefined value in ::init to be "known" in an other part of the script. Been looking at other scrips and don't understand what I'm doing wrong.

    I'm just trying to sys.println() a predefined number to see if what I'm doing works ... but I can't even do that : D

    #ifndef __REUSABLE_SCRIPT__
    #define __REUSABLE_SCRIPT__
    
    object poltergeist_script
    {
    	float	clicks; 
    
    	void	init();
    	void	OnOff();
    
    };
    
    //init
    void poltergeist_script::init()
    {
    	ResponseAdd(STIM_TRIGGER);
    	ResponseSetAction(STIM_TRIGGER,"OnOff");
    	ResponseEnable(STIM_TRIGGER,1);
    	clicks = 2;
    }
    
    //OnOff
    void poltergeist_script::OnOff()
    {
    	sys.println(clicks);
    }
    
    #endif __REUSABLE_SCRIPT__

    Whatever number I put in void poltergeist_script::init() / clicks , I  keep getting 0 in the console : (

  9. @MirceaKitsune

    Lol, I let your script and mine run together it does add up, where your script also has a difference in move speed and distance moved, my script just flings the stuff with the same speed. Also, sometimes two objects move at the same time this way or get influenced by the 2 scripts in the same move. Maybe you could try running your script 2 times (different names and different random triggers)?

    VIDEO - 2 annoyed Ghosts throwing stuff around

    I make a little bow for script btw, I can't abbreviate my thought into script like this, 'caus i'm thinking cogs and rods : )

    Also, is it an objective to set the ghosts free?

  10. 31 minutes ago, MirceaKitsune said:

    Found a much simpler way to get the flying objects effect I wanted: No movers or fake positional entities required, just a repeater to call the script and a sequencer to pick the random target. Using this method you can still leave the moving entity as frobable, it will only jump while you aren't holding it :)

    Nice! You are learning fast!

    You trigger it with a trigger with random wait time I guess? I posted a video with added fx. You could use the same trigger and an other trigger to tiggeron/off sound and visual fx : )

    In my adjusted script it also only jerks on it. Looks quite spooky actually. I found there is also moveable loot that can be used, only if the player get's the loot it's still listed in the trigger_sequencer, and the script stops when it can't find the (random chosen) entityname.

  11. @MirceaKitsune

    Ok, you can add the following to your script, that can be called by completing an objective:

    void ChangeMusic()
    {
    $LocSet.stopSound(0,0);  //LocSet is the name of the atdm:location_settings
    sys.trigger($FinalMusic);  //FinalMusic is the name of a atdm:speaker_ambient_music
    $LocSet.setKey("snd_room1","nosound");    //snd_room1 is the name of a location
    $LocSet.setKey("snd_room2","nosound");  
    }

    An atdm:speaker_ambient_music is heard in the whole map, so you set the music there that should be played from that moment to the end. You should aad this in your map and make shure to set s_waitfortrigger:1

     

  12. @Bienie

    That is even less script, so that's good : )

    I thought acuity_tact to 0 would somehow change the behaviour of AI a bit and would be least noticable on zombies. Intrestingly zombies don't seem to need having StimEnable (14, 0) on the dead bodies to not see them.

    Could you test with only acuity_tact:0? It looks like that might be the only thing needed from my quick test.

×
×
  • Create New...