Jump to content
The Dark Mod Forums


  • Posts

  • Joined

  • Last visited

  • Days Won


Everything posted by STRUNK

  1. Never worked with objectives, so I don't even know where to find (fill in) that : D The script I understand.
  2. @MirceaKitsune With a button you can also trigger scripts to run. $NPC_Name.kill(); should go in a script. In fact it's very simple, and can get very complicated. When you make a switch, instead of targeting a light ( ctrl+k), you can trigger a "atdm:target_callscriptfunction" (rightclick (with nothing selected) and choose Create entity -> Targets -> atdm:target_callscriptfunction. You'll get a yellow cube. Select the switch, then the yellow cube and press ctrl+k. Then select only the yellow cube. In the entity inspector you add a new "spawnarg" by typing in the first box: call and in the second box: kill, like this: Then you have to open notepad and type the following, where $Target_1 $Target_ etc (you can add more targets ofc.) are the names of the AI that should die, with $ in front of it ($gatekeeper, $guard2, $whatever ... ). void kill() //this could also be: void DropDead() if you set the spawnarg "call" to "DropDead" { $Target_1.kill(); $Target_2.kill(); $Target_3.kill(); } Then save it with the same name as your map as a .script file; yourmap.script. That .script file must now be put in the same directory as where your .map file is, and it should work. Springheels method is easier for this case, especially when you bind the damage brush to the AI ... but with a little knowledge of scripting you can do a whole lot of epic stuff : )
  3. @grayman That would be it : D But how to have a finished objective trigger that? (I never did anything with objectives)
  4. I'm trying to get stopAnim( float channel, float frames ) to work, but I don't even have a clue about what the channel should be : D And when putting -1 as frames, is it never going to stop (endles number of frames)? The ragdoll is working, but they keep flopping around a bit : P Other thing is, my approach would be scripting the event with becomeRagdoll and having the AI lay still. Simultaniously a death screem is triggered from speakers bound to the targeted guards. But I haven't got experience with AI in a map yet. How would you approach this?
  5. @MirceaKitsune I found this script event: BecomeRagdoll https://modwiki.dhewm3.org/BecomeRagdoll_(script_event) If you are familliar with writing scripts you can try if that does what you want, otherwise I can try making a simple script for it.
  6. The camera approach to the "portal" doesn't seem to work in any way I can imagine. Even tried adding a mirror to point the camera at. Now I had an other idea: having a brush with portal_sky texture, you can see through a wall with that, to move over a wall relative to the players position but the problem is .. you can only see through the wall when it's still worldspawn, so it can't be moved by script .. Does anyone know of an other glich that works when it's a func_mover ... or any other glich that might worth looking into?
  7. @MirceaKitsune There is a button in the top of the screen called "Select Group Parts" (looks like a rubix cube a bit). When you activate it you can select individual brushes .. it seems. Other entities like triggers and models can't be selected that way ... it seems. (I just tried this for the first time).
  8. I'm trying to recreate some sort of portal like in @Dragofer's post above and have a camera a target_null and a screen. I have the target_null moving relative (in an other room) to the players EyePos(ition) .. but it doesn't change the view. (have a visable cube bound to it to check if it it's indeed moving, and it is). When I place the target_null in a different place in DR, the view angle of the camera is different, so it seems to me it only checks whet the target_null is at gamestart, but doesn't update after that. Is there a spawnarg that should be applied to have it update all the time, or do I have to take a different approach and ajust the camera view angle (rotation) with a script? EDIT: Have the camera now looking around, but ofc. this doesn't work, for when you pan a camera, the straight horizontal lines get skewed on the screen : )
  9. @Dragofer I'm gonna try if this works : )
  10. @Dragofer If a camera was in an other room, and it stays in relatively the same position as the players head (getOrigin() and add distance in one direction to be in the other room). And you can make it "look" the same direction as the player (getViewAngles( )), you could have that video feed showing on a screen in the room where the player is, so he can see it.
  11. I was working on a random self moving thing that can detect boundries and turn away from them. The boundries work with a stim/response where the stim is the boundry and the respons is on a "sensor" in front of the moving func_mover, that is controlled by the script. The sensor has the response to run a function called Warning (when toutching the stim). In my small scale test I got it working flawlessly, but when I scaled it up and put boundries tot the walls of a big room things went totally wrong: big drop in framerate and it didn't work flawless at all ... bummer : D Here is a video of the test setup working at high speed (framerate is down due to OBS running): VIDEO Here is the script, maybe someone can use (parts of) it in the future for something:
  12. @Dragofer That is almost exacly what I tried, but it didn't work ... because of the setSkin I used. But now it works thanx : )
  13. I want to spawn a func_static and a func_mover from script ... is that possible?
  14. Is there something simple I can put in my script, or in my map that is realy eats resourses, so I can test what happens?
  15. @Dragofer If I getFrameTime() it returns 0.0160 so I guess that is the minimum time the engine can repeat/check things. But if I have a wait of 0.001 in a while() loop, it calculates every frame what would have happened in 16 times this while() loop .. right? I have a working script now and am determaning the right settings for maximum speed. Only problem is I can't get higher then a movement of 12 units in one loop, for it results in the enty escaping through the boundries: So I guess getting a higher speed means I have to find out how to get a greater distance in one loop (that always takes 0.0160 sec), without the escape ...
  16. There are different ways to let a script wait, like waitFrame() and wait() Does waitFrame() wait 1/60th of a second when the game runs at 60fps and 1/20th of a second at 20fps? If I use wait(0.01) or wait(0.001), it's a shorter wait period then waitFrame. What is the shortest "safe" wait period, and can a fast computer handle a shorter wait time then a slow computer?
  17. @joebarnin For now it kinda is, but the movement shoud be in 3d finally : ) The script is there now. Had to add comments to it and stuff.
  18. I'm working on a script for a random mover that will stay in an area that is set by boundries. Ok, I erased the question for I have answers t most of it already. New script down here:
  19. @Jedi_Wannabe Thanks! I'm working on the tiny fly now under a microscope : D But it will come together soon.
  20. Imagine a garden with fireflies sitting on stuff, when you come close they fly away into the dark. So I made a big firefly with wings and stuff and made it fly: FireFly Video Next is scaling it all down to fly size.
  21. Scripting the whole bat/moth seemed to be very difficult, so I made a simple script where a bat hunts after an object that moves by binding rotators and doors together: Although it takes some effort to implement in a map, the result is rather nice I think. It could, with some tweaking, also be used for other flying stuff ^^
  22. @AluminumHaste "bats move so fast you wouldn't be able to see any detail anyways". That is true. I made a new bat model, a bit bigger (can be scaled down ofc.), still very simple but without the glitches I got from modeling in DR in the smalest grid. Btw, the bat must be triggered one time before it starts hunting, so it could be lurking somewhere and fly out suddenly in front of you with a trigger multiple or something.
  23. In the following video you see a little white cube that's a func_rotating on the x axis, randomishly triggered by a trigger_timer to invert rotation. Bound to that is the red square plane, that's also a func_rotating, but on the z axis. Bound to that is the little blue cube, that's a sliding door (auto open auto close) named Target. Bat Mechanics The Bat itself is green in the video and is made up of two wing shaped atdm:mover_door's (auto open auto close) bound to a func_mover named Bat (the body of the bat). With 2 little scripts, activated once by atdm:target_callscriptfunction's, the Bat is following and turnig towards the Target: void MoveToTarget() { float min = 10; float max = 20; float rand = min + sys.random(max - min); $Bat.time (rand/30); $Bat.accelTime (0); $Bat.decelTime (0); $Bat.moveTo( $Target ); sys.wait (0.1); sys.trigger($ScriptMove); } void LookAtTarget() { vector direction=$Bat.getOrigin()-$Target.getWorldOrigin(); $Bat.setAngles(sys.VecToAngles(-direction)+'0 0 0'); sys.wait (0.1); sys.trigger($ScriptLook); } If anyone wants a bat flying around in their mission, just pm me for the model and stuff : )
  • Create New...