Jump to content
The Dark Mod Forums

STRUNK

Member
  • Posts

    471
  • Joined

  • Last visited

  • Days Won

    14

Everything posted by STRUNK

  1. @JackFarmer This lanternbot only turns toward you but stays idle in the same place. Don't know how it reacts on guards or monsters/
  2. @Dragofer Thanx for pointing out Obsttorte's turning statues script. He makes use of a system script event "VecToAngles()" that calculates the angle from a given vector. I took a part of the script and it now totally works without having to bind the statue to an elemental : ) void LookAtPlayer() { //Makes $Statue look at $player1 vector direction=$Statue.getOrigin()-$player1.getOrigin(); direction_z=0; $Statue.setAngles(sys.VecToAngles(-direction)+'0 90 0'); }
  3. @Dragofer I think a mover entity like that would be very useful to a lot of mappers. I only began looking into scripting since this year, and before thet I would usually use doors for like everything that has to move. If this entity was available then I would heve used it for sure. Only think I think of now is that it should be able to trigger things, like doors do. The script event to get rotation of an entity is vector getAngles() https://modwiki.dhewm3.org/GetAngles_%28script_event%29
  4. @Dragofer @JackFarmer I made a custom definition for func_mover_dragofer that has all the used spawnargs and "help" text in it, and it works so far. Only thing is you still need to manually target the atdm:target_callobjectfunction to call the script move_mover, and manually put in the names for the button and speaker. If we somehow can manage to get the name of the button targeting the func_mover_dragofer and have de audio play from the script + target the move_mover script from this definition, it would be rather awsome. Maybe it should have a frob on/of function like a door, and have an interuptable/not interuptable function also, so it can be triggered by frobbing, or any button/switch/trigger you want. Put a folder "def" in your own mission folder and put tdm_func.def in there. (re-start darkradiant) func_mover_dragofer should be selctable when you rightclick and select Create Entity. It's on the top of the list in "fms". tdm_func.def
  5. @Dragofer I checked out your scriptobject script and map, and it is awsome. This opens a lot of possibilities. Thank you very much for working this out!
  6. Result so far: https://streamable.com/ydj9i
  7. @Dragofer Ok, speed works : ) I was just about to get the distance with "float distance = $ReturnToThis.distanceTo($player1);" Then I wanted to put: "float speed = 1/distance", to feed "$BindToThis.speed (distance);" , but what is the right syntax for "float speed = 1/distance" ? Also thanx a lot for your help! It's greatly appreciated : ) == It's more like "distance/1000", but it also works float distance = $ReturnToThis.distanceTo($player1) $BindToThis.time (distance/1000);
  8. @Dragofer OH YES!!! void MoveToPlayer() { //Have entity "$BindToThis" move to the position of the head/eyes of the player en return to entity "$ReturnToThis" //Script is triggered by a "trigger_timer" timer targeting a "atdm:target_callscriptfunction" with spawnarg "call - MoveToPlayer" $BindToThis.time (0.8); $BindToThis.accelTime (0); $BindToThis.decelTime (0); vector head = $player1.getEyePos(); $BindToThis.moveToPos(head); sys.wait(1); $BindToThis.moveTo($ReturnToThis); } It totally works. Now I have to tweak it for constant speed, for now te speed is dependent on the distance the player is from entity "$ReturnToThis" I also have a gorgoyle (atm) as a turret and it looks at the player all the time. I did this with a tweaked elemental that stays in one place and gets the script event turnToEntity() that can only be used on AI. The gorgoyle binds to the elemental. Is there a way of scripting this without a (for me) very complex formula ... ?
  9. @Dragofer Ok, so there is also entity "bindToJoint()" and it seems to work, but wherever I bind an entity (to target at) to, it stays at the same hight ... so I guess $player1 is not like a normal AI. I will try getEyePos() then : ) Is there a way to "know" when the player is crouching?
  10. I see there is " entity getHead( ) " Returns the entity used for the character's head, if it has one. " If $player1 has a seperate entity as a head, and this script event can find it .. how can I let it tell me. Can I make the name show up in the console? I tried: entity head = $player1.getHead(); sys.print(head); But that doesnt work ...
  11. @Dragofer I see no getPos in the script reference (2.06), but I do see getOrigin. Thanx, I'll try and also get your river.script : )
  12. @Dragofer I'm making a shooter that shoots at the player, using moveTo($player1). It works so far, but it targets the feet of the player. I did bind a func_emiter to the entity that moves to the player and put it higher so it shoots at head level, but when I crouch down, it shoots over the head, ofcourse. Is there a head or torso entity that that I can target?
  13. @Dragofer Ok. Sounds good also, gonna try later. Thanx.
  14. Hmm, what do you mean by "call" here? In the "atdm:target_callscriptfunction" I have to "call" a script, and when I put "thread reusable_script($mover1, $speaker1, $button1);" there, it doesn't work. Can you explain how it should work?
  15. @Dragofer That looks like a leap in the right direction! Thank you, gonna try tomorrow.
  16. Make things look extra dusty/hazy can be done with "sys.fadeTo" , I found out today : ) https://streamable.com/5ts5p void FadeScreenToColorAlpha() { //Fades total screen to a set color and alpha in a set time sys.fadeTo('0.5 0.4 0.3', 0.3, 0.5); }
  17. @Dragofer I tried different strings also, but it just doesn't seem to work. sys.trigger($Sound) should do the same, but I didn't think of that yet. This mornig I decided to do the very short tutorial https://wiki.thedarkmod.com/index.php?title=A_Beginner's_Guide_to_Scripting That's where I seen this: // JoeBloggs: this script triggers a door to open and close in a test map void FrobDoor() { sys.print("\n\nYour script is running"); $TestDoor.activate($player1); } And I had downloaded the files from the cutscene tutorial : https://wiki.thedarkmod.com/index.php?title=Cutscenes_Part_1:_Cameras Playing around a bit with lights, and later motion I learned a lot today. Looking throug all the Script events there is so much that can be scripted : O One thing is that if you make something work with triggers ans s/r, you can copy all that you need for the "mechanism" and all will work, but with a script you have to rename all entitys again. Say you have a script involving light1, mover1 and particle1 and want to have the same, but triggered difrently for light2, mover2 and particle2, you need to copie the script and change the entity names. OR is there a trick for that?
  18. @JackFarmer Oh, what I did with smoke getting throug walls is to let the particle fx start when you enter the room, and stop when you get out of the room.
  19. @JackFarmer I did encounter the same problem some times and have no solotion but a workaround with a transparent camera gui ^^ But I guess it shoud be possible to customise the particle fx, so it doesn't drip that far down, with the Particle Editor (in Entity menu).
  20. So, I have been learnig a bit about scripting today, and came up with a script to do the partial rotation of an entity eacht time it's triggerd. void Rotate45() { //Rotates func_mover "Star" 45 degrees. You can set rotation to 90 or -90 or whatever you wish $Star.time (2); //Time the entity "Star" takes to rotate 45 degrees $Star.accelTime (1); //Acceleration time of the movement $Star.decelTime (1); //Decelleration time of the movement $Star.rotateOnce( '0 0 45' ); //Number of degrees of rotation on 1 axis sys.trigger($Sound); //Triggers speaker entity "Sound" $Button.setKey( "trigger_when_opened" , "0" ); //Disables the button "Button" to trigger anything sys.waitFor($Star); //Makes this script stop until the movement of Star has finished sys.trigger($Sound); //Triggers speaker entity "Sound" $Button.setKey( "trigger_when_opened" , "1" ); //Enables the button "Button" to trigger again } The sound while rotating is now controlled by targeting a speaker entity named "Sound" but ... there should be a better way, I think, but I can't get it to work. Does anyone know how to get the following scriptEvent's to work? scriptEvent void accelSound(string sound); Sets the sound to be played when the mover accelerates. scriptEvent void decelSound(string sound); Sets the sound to be played when the mover decelerates. scriptEvent void moveSound(string sound); Sets the sound to be played when the moving.
  21. @JackFarmer I don't think it coul'd solve this. You would have to manually add a new "effect" (turn light off/on) for every light, and it would take even more time.
  22. Video I purpously didn't put nodraw texture on elements that should finally be invisable, so you can see what is happening. At the white wall: A horizontal slider setup with a "mover_elevator", to control horizontal motion. From the button on the pillar, you trigger a trigger_sequencer, to have the slider go to the next stop. It has a "set frobable" function to ensure each stage is completed before all is triggerd again. The red blocks on the wall are the actual elevator buttons. When you frob one, the slider will go to that position. This wil f*ck up the working for the button on the pilar however, but it shows how it works with a (simpler) multiple button setup. (This setup is quite compilcated and the "door stack" method, on the black wall, might be more usefull and simpler in most cases (I think). A rotating star that rotates 45 degrees and then stops. It uses a custom Stim/Response to make it stop. The Stim is in the little green cube, the Response in the little red cubes (select one cube > Entity (top of the editor window) > Stim/Response ). This setup wil have you rotate something in the same direction, 45 degrees each time, endlessly. At the black wall: The "genious" door stacks : D One is a rotating setup, the other a translating setup. The botom door binds to nothing, the door above binds to the botom door, the door above that binds to the door below it etc. Because everyone understands doors, this is a very easy way to create "complex motion". Of course you can have one door rotate, the other translate, an other rotate on an other axis etc. Is there even a limit to what you can do? Yes, it can't do what the black star can do ... ^^ Questions? Ask them. Motion.map
  23. @JackFarmer This doorstack can be used for the slidingmotion also, but then with a simpler setup : O Instead of the doors rotating I have them translating !! You can also have one door translating, and an other rotating. I see a lot of uses for movement here : ) WS6 has all the setups from WS5 also. WS6.map
  24. @JackFarmer Nice!! I have been playing with the door stack, that has also audio. You could get the mechanism for the audio from here and I think it's a neat trick that could be used in for things in the future. The turning back feature on this woud be a lot of hassle with the s/r setup in WS1. For all: in this WS5 map are all 3 mechanisms (for partial rotation and translation), so if you're curious you only have to download this one. WS5.map
×
×
  • Create New...