Jump to content
The Dark Mod Forums

Newbie DarkRadiant Questions


demagogue

Recommended Posts

How hard would it be to open a lwo, move the origin about 10-20 doom units down the z-axis and re-save the results?

 

The procedure would be:

1. File -> Import the .lwo into Blender

2. Press 'a' (select all), 'g' (grab), 'z' (z-axis), 20 (up 20 units), enter (confirm)

3. File -> Export the .lwo again, with these settings checked in the exporter (off the top of my head):

  • idtech4 compatible
  • smoothing enabled
  • triangulate the faces
  • don't recalculate normals

 

The hardest part is getting the right importer/exporter. Here's the one I've been using: https://blenderartists.org/forum/showthread.php?336749-The-LWO-import-export-project

Edited by Dragofer
  • Like 1
Link to comment
Share on other sites

2. Press 'a' (select all), 'g' (grab), 'z' (z-axis), -20 (down 20 units), escape (deselect)

Shouldn't you move the model up, so the origin goes down relative to the model?

 

 

The hardest part is getting the right importer/exporter. Here's the one I've been using: https://blenderartists.org/forum/showthread.php?336749-The-LWO-import-export-project

You should also check, if the importer/exporter is compatible with the version you are using. Many import/export scripts only work for a specific version of blender.

Link to comment
Share on other sites

Shouldn't you move the model up, so the origin goes down relative to the model?

 

There should be enter before escape :)

 

 

Well... in my defence, it's like explaining how to tie shoelaces.

Link to comment
Share on other sites

 

Well... in my defence, it's like explaining how to tie shoelaces.

 

While I can wrestle DR into doing 3-point clipping the way I damn well want it, hay-suse is blender's interface a hot mess (I know, I know, powerful tools need powerful controls and yadda yadda...) so this is the type of walkthrough and links I needed.TYVM.

Link to comment
Share on other sites

There are channels devoted to teaching it, I just can't remember the ones I'm subbed to atm

I have an eclectic YouTube channel making videos on a variety of games. Come and have look here:

https://www.youtube.com/c/NeonsStyleHD

 

Dark Mod Missions: Briarwood Manor - available here or in game

http://forums.thedarkmod.com/topic/18980-fan-mission-briarwood-manor-by-neonsstyle-first-mission-6082017-update-16/

 

 

Link to comment
Share on other sites

Okay, it took some blind flailing but I have prevailed! I was just about to post a rambling update, as I was still having all sorts of problems. The biggest one seemed to be the inability to export lwo (it was grayed out) without the default Blender block in the file. As I walked through the steps and typed up exactly what was going on, I happened to hit the textured mode (somewhere on the right side of the screen). I couldn’t exactly tell you what else I did other than that but that allowed me to export and said export worked. 11kb bigger than the original for some reason, but it works.

Link to comment
Share on other sites

I am trying to set up a system with which to poison an AI and have encountered two problems:

1. I have a script that is supposed to kill the AI after a couple of seconds. However, when the script runs, it immediately kills the AI. It looks like this, right now:

void poison_wine()
{
sys.wait(10);
sys.print("\n\npoison wine is running");
$atdm_ai_burglar_1.kill();
}

I think an error like this, with sys.wait not working properly, was encountered by others earlier, but I cannot remember, where I have read it and how it was solved.

EDIT: The sys.print was just used to see, if the script runs in case the AI does not die and will be removed later on.

EDIT2: Nevermind. Looking through the TDM Script References page, I remembered, that you need a sys.waitFrame() at the beginning, so the thread is carried out correctly. So this is actually solved.

 

2. I seem to have made an error in my setup. I have created an inventory item "Poison" and made a goblet with the spawnargs "frobable 1", "used_by Poison" and "used_action_script poison_wine". The script runs, when I used "frob_script poison_wine" for testing, but it does not run, when Poison is used on the goblet. It blinks green, so it gets successfully used, but the script does not run.

Edited by Destined
Link to comment
Share on other sites

I have another question: In which pk4 are the inventory icons stored? I know the path: guis/assets/hud/inventory_icons/lockpick_snake_icon, but I can only find one "guis" folder (in the tdm_gui01.pk4) and this contains only a couple of gui-files. Each other pk4 I looked into did not contain any guis folder.

Link to comment
Share on other sites

They are in the dds subfolder. tdm_gui01.pk4 dds/guis/assets/hud/inventory_icons/...

FM's: Builder Roads, Old Habits, Old Habits Rebuild

Mapping and Scripting: Apples and Peaches

Sculptris Models and Tutorials: Obsttortes Models

My wiki articles: Obstipedia

Texture Blending in DR: DR ASE Blend Exporter

Link to comment
Share on other sites

The problem with the sound leaking out of a room is still there. All visportals are working, I even put extra caulk walls INSIDE the walls. Makes no sense.

 

On a second matter, I thought spiders were enemy by default. The relations wiki says they are, however the one I am using is neutral to the player.

So how do I make it an enemy. I want it to attack the player on sight. Also, another wierd thing is this spider disappears every time I deselect it

in the editor, and entities are NOT filtered. It was working fine, but then it just started getting sneaky. lol Any ideas?

Edited by NeonsStyle

I have an eclectic YouTube channel making videos on a variety of games. Come and have look here:

https://www.youtube.com/c/NeonsStyleHD

 

Dark Mod Missions: Briarwood Manor - available here or in game

http://forums.thedarkmod.com/topic/18980-fan-mission-briarwood-manor-by-neonsstyle-first-mission-6082017-update-16/

 

 

Link to comment
Share on other sites

You can check the "team" spawnarg of the spider. Maybe it got changed by accident. If it is the team that got friendly to the player, you can change the relations of teams to one another. Here it the according Wiki page. With the disappearing spider, I cannot help you. If the filter is not on, I have no idea what else could cause it. Have you tried disabling all filters, just to be sure?

Link to comment
Share on other sites

The problem with the sound leaking out of a room is still there. All visportals are working, I even put extra caulk walls INSIDE the walls. Makes no sense.

 

 

I had a problem like this with A Reputation to Uphold. I had sound leaking from one area to another even though there was no direct route the sound could take to get there. It was as if the sound were set to omni or global. Never did find the solution, so I just put another sound in to make the leaking.

Link to comment
Share on other sites

Yeh as I said Destined, I'd been through the AI Relations wiki page. No idea why it's not an enemy. Enemies are team -1, and you can't

use team spawnarg to set it to -1 cause in the AI tab on the entity inspector, teams can only be 0 or higher.

 

Spring, yeh I've done everything to fix both these rooms, and its really annoying. I guess I could add another sound over those spots

to cover it.

I have an eclectic YouTube channel making videos on a variety of games. Come and have look here:

https://www.youtube.com/c/NeonsStyleHD

 

Dark Mod Missions: Briarwood Manor - available here or in game

http://forums.thedarkmod.com/topic/18980-fan-mission-briarwood-manor-by-neonsstyle-first-mission-6082017-update-16/

 

 

Link to comment
Share on other sites

I am not sure, if I can follow. What team does the spider have? The default should be team 12. If you want to make sure that all AI in team 12 are hostile (which they should be by default), you can add an entity internal > atdm:team_relations and give it the spawnarg "rel 12,0" with the value "-1". This should set the relation of team 12 towards team 0 (which is the player) to hostile.

  • Like 1
Link to comment
Share on other sites

Hi all, I'm currently having some problems with scripting a clock tower. I'd like to use the prefab scriptevents clock, and my idea for the setup is thus: one of the four clocks will call the script that sets the sys time, which in turn is what eventually activates the chime. The other 3 clocks should sync with that clock through a similar method (just minus affecting sys time). This way, only one clock is responsible for the chiming, but all of them should always read the same time no matter what. Because of a conflict between the two runClock methods when attempting the main method route (they work independently, but not when applied together), I tried opting for a trigger setup. My script is as follows:

 

 

 

 void runClock(entity bigHand, entity smallHand)
 {
 	float hours = 11;
 	float mins = 59;
 	float secs = 58;
 	float strike = 0;
 
 	while (1)
 	{
 		bigHand.rotateOnce('0 0 0.1017');  //1 min in 59 secs as no move when hour incremented
 		sys.waitFor(bigHand);
 		secs = secs + 1;
 
 		//clone any number of these.....
 		if (mins == 99 && hours == 99) // set hours & mins to trigger any entity
 		{
 			$yourEntity.activate($player1);  //replace 'yourEntity' with any entity to be triggered
 		}
 
 		if (secs == 59)
 		{
 			smallHand.rotateOnce('0 0 0.5');
 			sys.waitFor(smallHand);
 			secs = 0;
 			mins = mins + 1;
 
 			if (mins == 60)
 			{
 				mins = 0;
 				hours = hours + 1;
 				sys.setcvar("game_clock_hours",hours);
 				$ClockStrike.activate($player1);

 				if (hours == 12)
 				{
 					hours = 0;
 				}
 			}
 		}
 	}
 }
 
  void runClockDummy(entity bigHand, entity smallHand)
 {
 	float hours = 11;
 	float mins = 59;
 	float secs = 58;
 	float strike = 0;
 
 	while (1)
 	{
 		bigHand.rotateOnce('0 0 0.1017');  //1 min in 59 secs as no move when hour incremented
 		sys.waitFor(bigHand);
 		secs = secs + 1;
 
 		//clone any number of these.....
 		if (mins == 99 && hours == 99) // set hours & mins to trigger any entity
 		{
 			$yourEntity.activate($player1);  //replace 'yourEntity' with any entity to be triggered
 		}
 
 		if (secs == 59)
 		{
 			smallHand.rotateOnce('0 0 0.5');
 			sys.waitFor(smallHand);
 			secs = 0;
 			mins = mins + 1;
 
 			if (mins == 60)
 			{
 				mins = 0;
 				hours = hours + 1;
 				//sys.setcvar("game_clock_hours",hours);
 				$ClockStrike.activate($player1);

 				if (hours == 12)
 				{
 					hours = 0;
 				}
 			}
 		}
 	}
 }
 
  void clockChime()
 {
 	float hours = sys.strToFloat(sys.getcvar("game_clock_hours"));
 	float strike = 1;
 
 	while(strike <= hours)
 	{
 		$ClockStrike.startSound("snd_effect", SND_CHANNEL_BODY, false);
 		sys.wait(3);
 		strike = strike + 1;
 	}
 }

void startClock()
{
	runClock($clock_hand_big, $clock_hand_small);
}
 
void startClock2()
{
	runClockDummy($clock_hand_big2, $clock_hand_small2);
}

void startClock3()
{
	runClockDummy($clock_hand_big3, $clock_hand_small3);
}

void startClock4()
{
	runClockDummy($clock_hand_big4, $clock_hand_small4);
}
 
void main ()
 {
	sys.waitFrame();
 }

 

 

 

I then attempted to set a trigger on a normal worldspawn brush to a trigger relay. This in turn is set to trigger multiple atdm:target_callscriptfunction entities, all set to activate their respective startClock methods. The idea is to activate all clocks on map start.

 

Predictably, none of it is working, which means I done goofed somewhere. The hands all have the proper names, so I know it's not that. Any ideas on how I can fix this?

Link to comment
Share on other sites

You could try to use the "getAngles" script event to read out the rotation of the main hands and then use "setAngles" on the other hands to synchronise the clocks. If you use these directly after changing the angles of your main clock in the script, they should always have the same rotation without the need for the whole "ClockDummy" part. Just remeber that you will have to accommodate for their initial rotation.

Link to comment
Share on other sites

 

void runClock(entity bigHand, entity smallHand)
{
    float hours = 11;
    float mins = 59;
    float secs = 58;
    float strike = 0;

    while (1)
    {
        bigHand.rotateOnce('0 0 0.1017'); //1 min in 59 secs as no move when hour incremented
        sys.waitFor(bigHand);
        secs = secs + 1;

        //clone any number of these.....
        if (mins == 99 && hours == 99) // set hours & mins to trigger any entity
        {
            $yourEntity.activate($player1); //replace 'yourEntity' with any entity to be triggered
        }

        if (secs == 59)
        {
            smallHand.rotateOnce('0 0 0.5');
            sys.waitFor(smallHand);
            secs = 0;
            mins = mins + 1;

            if (mins == 60)
            {
                mins = 0;
                hours = hours + 1;
                sys.setcvar("game_clock_hours",hours);
                $ClockStrike.activate($player1);

                if (hours == 12)
                {
                    hours = 0;
                }
            }
        }
    }
}

 

Some notes:
  • is it really necessary to count the seconds, wouldn't minutes be sufficient? (The angle change is very small and might lead to rounding errors)
  • if (mins==99 && hours==99) this condition will never be true as you reset mins to zero once it reaches 60, and hours is set to zero if it reaches twelve
  • game_clock_hours such a cvar doesn't exist. If you need to store the data, use a persistent arg or store it a a spawnarg on an entity of your choice (I use worldspawn for this, the entity name is world), alternatively you can store it in the script in a global variable
  • the methods startClockX() are called nowhere. Do you call them from the map? The only method that gets automatically called on mission start is main()
  • if you want the clocks to be synchronized it doesn't make much sense to update their movement in seperate functions as Destined already said. You only get additional workload and can't guarentee them to stay synced.
  • due to the waitfor commands the clock will probably not be exact
  • via getTime() you can get the amount of seconds passed since mission start. You can work with that one to run the clock
This is a function that will convert the mission time to hours/minutes/seconds format. I haven't testet it but it should work. The result is stored in a vector (3 components)

vector getHMS() //HMS- hours, minutes, seconds
{
    float time = sys.getTime(); //mission time in seconds
    vector hms;                       //our result, x-hours, y-minutes, z-seconds
    hms_x=int(time/3600);
    hms_y=int( (time%3600)/60);
    hms_z=time%60;
    return hms;
}
The '%' is the modulo operator. It returns the remainder of an intiger division. For example 5%2=1 as 5/2=2R1.
  • Like 1

FM's: Builder Roads, Old Habits, Old Habits Rebuild

Mapping and Scripting: Apples and Peaches

Sculptris Models and Tutorials: Obsttortes Models

My wiki articles: Obstipedia

Texture Blending in DR: DR ASE Blend Exporter

Link to comment
Share on other sites

Guessing that an angle of zero would represent the clock hand pointing at zero and that the angles are interpreted clockwise, the clock hand angles would derive from the above mentioned vector (called hms below) in the following way:

  • short clock hand (hours): angle = (hms_x%12)*30 (I'm not sure whether the modulo operator is evaluated before the multiplication, therefore the brackets)
  • long clock hand (minutes): angle = hms_y*6
  • very long clock hand (seconds, if needed): angle = hms_z*6

This puts the angle in the interval [0;360]. I think the game uses the range [-180;180]. There is a helper function defined in tdm_util.script iirc. It roughly looks like this:

float angleConvert(float angle)
{
     if (angle >180) return (angle - 360);
     return angle;
}

FM's: Builder Roads, Old Habits, Old Habits Rebuild

Mapping and Scripting: Apples and Peaches

Sculptris Models and Tutorials: Obsttortes Models

My wiki articles: Obstipedia

Texture Blending in DR: DR ASE Blend Exporter

Link to comment
Share on other sites

Or you could just subtract 180 from the original angle:

  • short clock hand (hours): angle = ((hms_x%12)*30)-180
  • long clock hand (minutes): angle = (hms_y*6)-180
  • very long clock hand (seconds, if needed): (angle = hms_z*6)-180

This would also set it in the range [-180;180]. The starting angle depends on which time the clock should show at mission start and could be added to the angles beforehand. Not sure which andle is 0. I am also not 100% sure, around which axis the whole system rotates, but this can be determined easy enough...

Link to comment
Share on other sites

I am not sure, if I can follow. What team does the spider have? The default should be team 12. If you want to make sure that all AI in team 12 are hostile (which they should be by default), you can add an entity internal > atdm:team_relations and give it the spawnarg "rel 12,0" with the value "-1". This should set the relation of team 12 towards team 0 (which is the player) to hostile.

 

Right, yes that worked a treat. Thanks Destined. :D

Edited by NeonsStyle

I have an eclectic YouTube channel making videos on a variety of games. Come and have look here:

https://www.youtube.com/c/NeonsStyleHD

 

Dark Mod Missions: Briarwood Manor - available here or in game

http://forums.thedarkmod.com/topic/18980-fan-mission-briarwood-manor-by-neonsstyle-first-mission-6082017-update-16/

 

 

Link to comment
Share on other sites

 


Or you could just subtract 180 from the original angle:

This is not exactly the same. ;)

 

With your method, +/- 180 degrees will equal zero minutes or hours. With the method I mentioned above 0 / 360 degrees will equal zero minutes/hours.

 

You version will work, too though. (And is slightly more simple :) )

FM's: Builder Roads, Old Habits, Old Habits Rebuild

Mapping and Scripting: Apples and Peaches

Sculptris Models and Tutorials: Obsttortes Models

My wiki articles: Obstipedia

Texture Blending in DR: DR ASE Blend Exporter

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recent Status Updates

    • OrbWeaver

      Does anyone actually use the Normalise button in the Surface inspector? Even after looking at the code I'm not quite sure what it's for.
      · 7 replies
    • Ansome

      Turns out my 15th anniversary mission idea has already been done once or twice before! I've been beaten to the punch once again, but I suppose that's to be expected when there's over 170 FMs out there, eh? I'm not complaining though, I love learning new tricks and taking inspiration from past FMs. Best of luck on your own fan missions!
      · 4 replies
    • The Black Arrow

      I wanna play Doom 3, but fhDoom has much better features than dhewm3, yet fhDoom is old, outdated and probably not supported. Damn!
      Makes me think that TDM engine for Doom 3 itself would actually be perfect.
      · 6 replies
    • Petike the Taffer

      Maybe a bit of advice ? In the FM series I'm preparing, the two main characters have the given names Toby and Agnes (it's the protagonist and deuteragonist, respectively), I've been toying with the idea of giving them family names as well, since many of the FM series have named protagonists who have surnames. Toby's from a family who were usually farriers, though he eventually wound up working as a cobbler (this serves as a daylight "front" for his night time thieving). Would it make sense if the man's popularly accepted family name was Farrier ? It's an existing, though less common English surname, and it directly refers to the profession practiced by his relatives. Your suggestions ?
      · 9 replies
    • nbohr1more

      Looks like the "Reverse April Fools" releases were too well hidden. Darkfate still hasn't acknowledge all the new releases. Did you play any of the new April Fools missions?
      · 5 replies
×
×
  • Create New...