Jump to content
The Dark Mod Forums

Search the Community

Showing results for tags 'script'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • General Discussion
    • News & Announcements
    • The Dark Mod
    • Fan Missions
    • Off-Topic
  • Feedback and Support
    • TDM Tech Support
    • DarkRadiant Feedback and Development
    • I want to Help
  • Editing and Design
    • TDM Editors Guild
    • Art Assets
    • Music & SFX

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests

Found 8 results

  1. Hi, i start with a new fan mission but i get a problem, when i shot with a custom weapon that launch a lot of projectiles with a lot of spread,(like a shotgun) the projectile spread don't work, all projectiles are launched in to the same place (center view), it's very frustrating, maybe its a code bug, but in the weapon script "launchprojectiles();" the spread and the num_projectiles are not working. Please, if anyone knows how i can fix it, just leave a reply or any information about that. If someone works on the official code, maybe can fix that issue for the new release, that can be useful for people that wants improve the actual weapons. Sorry for my basic english, my mother language is spanish
  2. I created this script for personal use, but thought it would be of enough interest to share here. I'm in the process of porting a few texture packs into TDM from Xonotic... each texture containing a diffuse / normal / specular map, as well as optionally a glow / reflection map. Obviously I don't want to have to manually create the same material for every texture, so I made a script to do it for me! Usage: Save this as a .sh file and place it in your texture pack's directory, next to the texture pack's subdirectories. Adjust the variables to match your texture package. Then just run the script: A mtr file should be generated, containing entries for each texture based on the maps it offers. #!/bin/bash # idTech4 material generator, by MirceaKitsune # texture pack info name="mypack" author="myself" # file and directory paths base="textures/mymod/${name}" mat="tdm_${name}.mtr" ext="tga" # special maps map_glow="glow" map_norm="norm" map_gloss="gloss" map_reflect="reflect" cubemap="env/gen2" # special parameter param="metal" rm "./${mat}" echo "// Name: ${name}" >> "./${mat}" echo "// Author: ${author}" >> "./${mat}" echo "// Material Directory: ${base}" >> "./${mat}" for d in *; do if [[ -d "${d}" ]]; then cd "./${d}" for f in *.tga; do if [[ -f "${f}" ]] && [[ "${f}" != *"_${map_glow}.${ext}"* ]] && [[ "${f}" != *"_${map_norm}.${ext}"* ]] && [[ "${f}" != *"_${map_gloss}.${ext}"* ]] && [[ "${f}" != *"_${map_reflect}.${ext}"* ]]; then f_noext=$(echo "${f}" | cut -d "." -f 1) echo "" >> "../${mat}" echo "${base}/${d}/${f_noext}" >> "../${mat}" echo "{" >> "../${mat}" echo " qer_editorimage ${base}/${d}/${f_noext}" >> "../${mat}" echo " description \"${name}, ${d}, ${f_noext}\"" >> "../${mat}" echo "" >> "../${mat}" echo " ${param}" >> "../${mat}" echo "" >> "../${mat}" echo " diffusemap ${base}/${d}/${f_noext}" >> "../${mat}" if [[ -f "${f_noext}_${map_norm}.${ext}" ]]; then echo " bumpmap ${base}/${d}/${f_noext}_${map_norm}" >> "../${mat}" fi if [[ -f "${f_noext}_${map_gloss}.${ext}" ]]; then echo " specularmap ${base}/${d}/${f_noext}_${map_gloss}" >> "../${mat}" fi if [[ -f "${f_noext}_${map_glow}.${ext}" ]]; then echo "" >> "../${mat}" echo " // Glow" >> "../${mat}" echo " {" >> "../${mat}" echo " blend add" >> "../${mat}" echo " map ${base}/${d}/${f_noext}_${map_glow}" >> "../${mat}" echo " }" >> "../${mat}" fi if [[ -f "${f_noext}_${map_reflect}.${ext}" ]]; then echo "" >> "../${mat}" echo " // Reflection" >> "../${mat}" echo " {" >> "../${mat}" echo " maskcolor" >> "../${mat}" echo " map makealpha(${base}/${d}/${f_noext}_${map_reflect})" >> "../${mat}" echo " }" >> "../${mat}" echo " {" >> "../${mat}" echo " blend gl_dst_alpha, gl_one" >> "../${mat}" echo " maskalpha" >> "../${mat}" echo " cubeMap ${cubemap}" >> "../${mat}" echo " texgen reflect" >> "../${mat}" echo " }" >> "../${mat}" fi echo "" >> "../${mat}" echo " // Frob highlighting" >> "../${mat}" echo " {" >> "../${mat}" echo " if ( parm11 > 0 )" >> "../${mat}" echo " blend gl_dst_color, gl_one" >> "../${mat}" echo " map _white.tga" >> "../${mat}" echo " rgb 0.40 * parm11" >> "../${mat}" echo " }" >> "../${mat}" echo " {" >> "../${mat}" echo " if ( parm11 > 0 )" >> "../${mat}" echo " blend add" >> "../${mat}" echo " map ${base}/${d}/${f_noext}" >> "../${mat}" echo " rgb 0.15 * parm11" >> "../${mat}" echo " }" >> "../${mat}" echo "" >> "../${mat}" echo " // TDM Ambient Method" >> "../${mat}" echo " {" >> "../${mat}" echo " if ( global5 == 1 )" >> "../${mat}" echo " blend add" >> "../${mat}" echo " map ${base}/${d}/${f_noext}" >> "../${mat}" echo " scale 1, 1" >> "../${mat}" echo " red global2" >> "../${mat}" echo " green global3" >> "../${mat}" echo " blue global4" >> "../${mat}" echo " }" >> "../${mat}" echo "}" >> "../${mat}" fi done cd ".." fi done
  3. Do you know by chance how to pass values of variables from script to GUI ? This GUI I have been working on is for a self-driving vehicle. Player would have to find a fuel cell (power cell) item to place into the vehicle before he can get a ride. So basically when player trips a trigger entering the vehicle, a script would check for a variable "vehicleIsReady" and if it's 0 (player never placed power cell into vehicle), my GUI would display a red screen saying "out of fuel" and if vehicleIsReady is set to 1, then normal GUI will be displayed (as seen on the video). How would I do that? Currently I can set variables in GUI code as set "Desktop::variable" "value"; and check if ( "Desktop::variable" == value ) {} but that's for internal to GUI variables/values. I don't know how to pass script variable into GUI using gui_parms, if in some other way. Please help. Thanks beforehand.
  4. Is it possible to have a digital clock in a GUI on a map ? Basically looking for 24hrs format hrs:min clock in a windowDef. I recall there gotta be a built-in script function for time, but I don't know how to pass the data from script to GUI (preferably updating GUI either every second or every minute, only when in player's view) Done! (see the last post) Thanks!
  5. Currently I got system that snaps a particular entity from location A to location B. So it's an instant movement. What I need is the following. I need to move entity from A to B, not snap it, over the course of time. So instead of an instant snap, it will move from A to B in 2 sec (for example). My guess it that I need to advance coordinate in SetWorldOrigin(I think that's what I use currently to change location of the entity) in a loop, but I am having brain fart and can't put it all together. I am thinking it could be SetWorldOrigin( currentOrigin ) where currentOrigin = ( destinationB - currentOrigin ) / granularity. vector currentOrigin = sourceA; vector granularity = '100 100 100' ; delta = ( destinationB - currentOrigin ) / granularity; loop begins SetWorldOrigin( currentOrigin ); currentOrigin = currentOrigin + delta; loop ends Something like that? I assume time should be in the condition of the loop? If so, how to I plug it in and have it updated? What if time runs out, but entity is still in between source and destination ? How would I make it where entity will move from A to B in the given time, guaranteed ? Thanks! EDIT: Should I do something like the following ? currentTime = time; while (currentTime <= 2sec) { ... code in the loop from above ... currentTime = currentTime + timeIncrement; } and timeIncrement probably would be 2 sec / ( (B - A) / 2 sec ) ?
  6. Apparently func_mover can only begin moving from the beginning of the spline and on stop, it gets reset to its starting position. I am making something that has to be controlled from a GUI panel, and I need for func_mover to stop on the spline where I want, continue moving from that position, and not reset to the start position (which should be some bool spawn arg in the entity's def). How can I fix that? (unless func_mover already does it by default and I just have no clue what I am doing ) Thanks.
  7. How do I find an entity of a given class in the game's world using SDK code (C++) or/and script ? For example Quake has something like find(e); a built-in that returns entity when it finds it. Does Doom 3 SDK have something similar ?
  8. Hi, what i want is to compare two floats. It's about checking the distance between the player and an AI and start a script if the distance is bigger than 128. I wrote: void folgehelfer() { boolean eingreifen; string abstand; abstand = $player1.distanceTo($helfer1); sys.println(abstand); eingreifen = abstand > 128; if (eingreifen = true) { call unbefugt(); } } it doesnt work: type mismatch for '>' Does TDM / D3 know '>' and '<'? What is wrong?
×
×
  • Create New...