Jump to content
The Dark Mod Forums

Newbie DarkRadiant Questions


demagogue

Recommended Posts

Like this?


void removeInsideThread(entity activator)
{
    ai a = activator;
    If (a)
{
    sys.wait(sys.random(1));
    activator.remove();
}
}

void removeInside(entity activator)
{
    thread removeInsideThread(activator);
}

It shows 'Unknown value "If" '

anyway, isn't AI replaced with ragdolls after they die?

 

 

And why changing order of these two blocks ends with error:

void removeInside(entity activator)
{
    thread removeInsideThread(activator);
}

void removeInsideThread(entity activator)
{
    sys.wait(sys.random(1));
    activator.remove();
}

-Unknown value "removeInsideThread" (first one).

 

But this is fine:

void removeInsideThread(entity activator)
{
    sys.wait(sys.random(1));
    activator.remove();
}

void removeInside(entity activator)
{
    thread removeInsideThread(activator);
}

S2wtMNl.gif

Link to comment
Share on other sites

 


It shows 'Unknown value "If" '

Its "if", not "If". (small letters)

 


And why changing order of these two blocks ends with error:

Because you cannot refer to a value or function that hasn't been defined previously.

  • 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

What free program(s) will be the best/easiest to make an intro video like in "The Accountant 1" - static image, zooming out. Of course I can make a gif frame by frame, copying and scaling source image a bit more for every frame, but maybe there is a simpler way you would recommend? And about adding sounds - Windows Movie Maker will do the job?

S2wtMNl.gif

Link to comment
Share on other sites

How to spawn a model / entity from a list randomly, like a sound from list specified in sound definition?

I think you want SEED "Random Decorator"

 

http://wiki.thedarkmod.com/index.php?title=SEED_-_Usage

 

http://forums.thedarkmod.com/topic/12107-announcement-seed-system/page-6?do=findComment&comment=246990

Please visit TDM's IndieDB site and help promote the mod:

 

http://www.indiedb.com/mods/the-dark-mod

 

(Yeah, shameless promotion... but traffic is traffic folks...)

Link to comment
Share on other sites

Not really. I was thinking about a randomised maze. Tels was doing something like that and my approach is more schematic.

http://forums.thedarkmod.com/topic/14119-procedural-dungeon-crawler-generation-swift-mazes/?hl=%2Brandom+%2Bmaze&do=findComment&comment=295696

Mine is maybe more like the HeroQuest board game; invisible rooms and corridors with visportals are in place, but they are filed with random details:

o6sonjk.png

Every corridor intersection and every room would have 1-4 doors, rooms additional hole in floor and/or ceiling. Every model would be rotated randomly by 90/180/270 degrees. So will be room's content. In this form it still can generate "impossible" set with one part of dungeon sealed from another but I don't care atm.

So I need a specific place to spawn randomly a model / prefab (is it possible?) from a list, rotated by 0/90/180/270 degree.

Edited by ERH+

S2wtMNl.gif

Link to comment
Share on other sites

Not sure if its possible or not, but before you get tangled up in technicalities, I would first consider if rogue like, random dungeons is what you think would work best in your vision for TDM gameplay. Nothing against a well designed maze-like mission (not really a fan myself, but Im sure a lot of people like that), but by definition, a well designed mission of any genre needs a lot of detailing and storytelling. Tels was trying to go for a system where you would get a certain quantity of "blocks" that had a lot of content in them, templates that you would then expand upon by adding in your storyline or scripted sequence or whatever. My guess is that you would first generate a random map, and then you would dive into it and change some things around and add readables and patrols and what not. This system in itself is not bad at all, though the amount of work to make blocks that are actually useful for mappers is a pretty daunting task. What Im not certain about is the necessity of making it random, I cant really see an advantage to it instead of just making it a prefab pack with examples and ready made scenes people could use to create their own maps deliberately, by hand.

Link to comment
Share on other sites

You can spawn, translate, rotate and remove entities via script. You can toggle aas routes (ai pathfinding) and block off areas, either via triggers or ... via script. So yes, it is possible.

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

You can spawn, translate, rotate and remove entities via script. You can toggle aas routes (ai pathfinding) and block off areas, either via triggers or ... via script. So yes, it is possible.

But I'm asking about spawning random entity from a list, something like that:

 

room = sys.spawn(RoomList);

 

RoomList

{

room1

room2

room3

...

}

 

room.setOrigin('-352 -64 -2144');

room.setAngles('0 90 0');

 

And I have no idea what exact command would work in that way.

S2wtMNl.gif

Link to comment
Share on other sites

There are several possible approaches that come to my mind:

  • you can store the list of entities in an xdata file
  • you can store the list of entities as spawnargs on worldspawn
  • you can store the list of entities in an entitydef, which would preferable use the scriptobject handling the placement (a mixture of the above two)

The code would differ depending on the approach choosen (pseudocode following, not tested and will not work if just copied!)

 

xdata

You would have to read out the definitions from the xdata first and store them in an string. See tdm_readables.script on how to work with xdata as well as this

 

worldspawn

This code would either be used in an scriptobject or be put in your global map script file

 

x = sys.random(num_rooms);                       // num_rooms - the amount of different rooms available
roomEntityName = $world.getKey(prefix+x); // prefix is the starting term for all room names to refer to, like room1, room2, room3, ... the prefix would be room
room = sys.spawn(roomEntityName);
...

 

entity

The following code would belong to the scriptobject used on the entity storing the list as spawnargs

 

x = sys.random(num_rooms);            // num_rooms - the amount of different rooms available
roomEntityName = getKey(prefix+x); // prefix is the starting term for all room names to refer to, like room1, room2, room3, ... the prefix would be room
room = sys.spawn(roomEntityName);
...
  • Like 2

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

i read it as well early after the post was made, i couldn't work out what had been done, the only uncomfortable thing was directly changing world_brushes to entity brushes without using convert world brush/s to a func_static came across as the worse thing you could do. its likely you ended up with a map file containing a list of more than one map definition, when dark radiant loaded that file it got confused about which map definition should be loaded and broke the camels back.

I think that's what happened - gonna have to remove DR and reinstall it all from scratch - idk what happened to break it in that way. Can't figure it out and don't want to reproduce it. Think it was choosing one of the entity classes that is at the bottom of the list that isn't an entity class, but a def that is somehow displayed in the list.

Link to comment
Share on other sites

I'm having a problem in my mission where on certain difficulties the player is handed two versions of the map. Easy difficulty it's just one, but medium and hard it's two.

I don't think it's a shop problem since I've checked it and there's no mention of maps in there. Furthermore if the player decides to drop the map in the shop he has no map when spawned.

I've looked through all my entities for duplicate atdm:map_of's. I do have a separate map of the mansion that you have to find in game on hard difficulty (but not on medium so I don't think that is related).

Is there any other place where there could be instructions to give the player a map? Maybe in a file in my fm folder somewhere? Or could it be a rougue spawnarg on some entity? Could there be some glitching with the atdm:map_of entities? (I have 5 in total; One for the street map (which is the one I'm having problems with), two for the mansion 1st floor map (easy+medium has inv_map_start 1 and the other entity has it 0 for hard) and two for mansion 2nd floor map (same principle as 1st floor).

My Fan Missions:

   Series:                                                                           Standalone:

Chronicles of Skulduggery 0: To Catch a Thief                     The Night of Reluctant Benefaction

Chronicles of Skulduggery 1: Pearls and Swine                    Langhorne Lodge

Chronicles of Skulduggery 2: A Precarious Position              

Chronicles of Skulduggery 3: Sacricide

 

 

 

Link to comment
Share on other sites

I have 5 in total; One for the street map (which is the one I'm having problems with), two for the mansion 1st floor map (easy+medium has inv_map_start 1 and the other entity has it 0 for hard) and two for mansion 2nd floor map (same principle as 1st floor.

And can I ask on Bienie's behalf, can the in-game map have multiple pages..? as for each floor of a given building.

Link to comment
Share on other sites

And can I ask on Bienie's behalf, can the in-game map have multiple pages..? as for each floor of a given building.

If you change the gui and probably the related script object as well this should be doable.

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

Update on the double map problem: Starting the map from the menus is what's causing the extra map, while loading from console makes it work as intended. I think there is something fishy with the shop entity, eventhough there is no mention of any maps in the spawnargs. Is there any other way that shop items are defined that I may have overlooked?

My Fan Missions:

   Series:                                                                           Standalone:

Chronicles of Skulduggery 0: To Catch a Thief                     The Night of Reluctant Benefaction

Chronicles of Skulduggery 1: Pearls and Swine                    Langhorne Lodge

Chronicles of Skulduggery 2: A Precarious Position              

Chronicles of Skulduggery 3: Sacricide

 

 

 

Link to comment
Share on other sites

Starting the map from the menus is what's causing the extra map, while loading from console makes it work as intended.

Not true, at least on my end. See beta thread.

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

If a model has a collision material, does the engine only use that for collision? I.e. does it disregard all other polys when collision detecting? If so, how does it know what material sounds to use? Does it perform some kind of hit testing to the nearest real poly?

 

I looked at a barrel model and noticed there's nothing in the material def that disabled collisions.

 

Edit: I just noticed (or re-noticed, since I saw this ages ago) that there are materials for collision stone, collision wood etc, which happen to share the same texture, so that answers the surface type question.

Edited by R Soul
Link to comment
Share on other sites

If a model has a collision material, does the engine only use that for collision? I.e. does it disregard all other polys when collision detecting? If so, how does it know what material sounds to use? Does it perform some kind of hit testing to the nearest real poly?

 

Nope, you have to use the nonsolid global keyword in your material. Otherwise the engine will use both. You can preview collision with g_showCollisionModels 1 to see if it works properly. The camera has to be close to a model though.

Link to comment
Share on other sites

If a model has a collision material, does the engine only use that for collision? I.e. does it disregard all other polys when collision detecting? If so, how does it know what material sounds to use? Does it perform some kind of hit testing to the nearest real poly?

 

I looked at a barrel model and noticed there's nothing in the material def that disabled collisions.

 

Edit: I just noticed (or re-noticed, since I saw this ages ago) that there are materials for collision stone, collision wood etc, which happen to share the same texture, so that answers the surface type question.

 

I forget whether it's nodraw_solid textures or collision textures (I think it's the latter), but if you add one of them to a model, the engine no longer reads the other materials for collision. I ran into this when adding a collision mesh to a diagonal window awning on a wall module. The entire wall became nonsolid after that.

Link to comment
Share on other sites

Since there was some disagreement, I did a test with a blatantly wrong collision model, and can confirm that when a model uses materials from tdm_collision.mtr (tdm_collision_metal, tdm_collision_stone etc), their polys are the only ones that affect collision. A comment in the .mtr file also states that they take over AI vision blocking too, instead of the visual model, which is a bonus.

Link to comment
Share on other sites

I'm assuming skybox material like mountain_sunset works in a same way as cube map, and I can't rotate it by simply rotating patch. Do I need to make a new material definition with rearranged textures, or is there a simpler way?

S2wtMNl.gif

Link to comment
Share on other sites

I have script with

sys.setcvar("pm_walkspeed", 300);

for fast diving in huge water area, it is restored to 70 when needed - but if I end the game with 300 value ongoing, and restart whole game, I will run fast from the start. So cvar values like this one are stored somewhere even if game was restarted?

S2wtMNl.gif

Link to comment
Share on other sites

Some cvars are persistent, some are not. Messing with cvars via script to alter the game behaviour is not adviced.

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

I'm making a cutscene, and in order to hear the sounds as the camera flies through the environment, I needed to bind the player to a mover. I managed to do that with $player1.bind($mover1); but for some reason I can't unbind the player from the same mover at the end of the sequence. Using $player1.unbind($mover1); results in "too many parameters" error. Is there any other way to do that, or am I just doing something wrong?

Edit: oh, I found the solution, you don't need to specify the entity the player is bound to. You need to use just $player1.unbind();.

Edited by Judith
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

    • taffernicus

      i am so euphoric to see new FMs keep coming out and I am keen to try it out in my leisure time, then suddenly my PC is spouting a couple of S.M.A.R.T errors...
      tbf i cannot afford myself to miss my network emulator image file&progress, important ebooks, hyper-v checkpoint & hyper-v export and the precious thief & TDM gamesaves. Don't fall yourself into & lay your hands on crappy SSD
       
      · 2 replies
    • 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
×
×
  • Create New...