Jump to content


Photo

Newbie DarkRadiant Questions


8317 replies to this topic

#8101 ERH+

ERH+

    Advanced Member

  • Member
  • PipPipPip
  • 711 posts

Posted 13 March 2018 - 02:13 AM

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


#8102 Obsttorte

Obsttorte

    Scripting guru, Mapper

  • Active Developer
  • PipPipPipPipPip
  • 5653 posts

Posted 13 March 2018 - 02:15 AM


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.


  • ERH+ likes this
FM's: Builder Roads, Old Habits, Old Habits Rebuild
WIP's: Several. Although after playing Thief 4 I really wanna make a city mission.
Mapping and Scripting: Apples and Peaches
Sculptris Models and Tutorials: Obsttortes Models
My wiki articles: Obstipedia
Let's Map TDM YouTube playlist: ObstlerTube
Texture Blending in DR: DR ASE Blend Exporter

End of shameless self promotion.

#8103 ERH+

ERH+

    Advanced Member

  • Member
  • PipPipPip
  • 711 posts

Posted 14 March 2018 - 04:37 PM

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


#8104 RPGista

RPGista

    Advanced Member

  • Member
  • PipPipPip
  • 1563 posts

Posted 14 March 2018 - 08:45 PM

I would use Blender for that. Apart from some issues with performance, it has an amazingly versatile video editor in it. 


  • ERH+ likes this

#8105 ERH+

ERH+

    Advanced Member

  • Member
  • PipPipPip
  • 711 posts

Posted 15 March 2018 - 10:42 PM

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


S2wtMNl.gif


#8106 nbohr1more

nbohr1more

    Darkmod PR, Wordsmith

  • Development Role
  • PipPipPipPipPip
  • 8931 posts

Posted 15 March 2018 - 11:23 PM

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.thedarkm...le=SEED_-_Usage

 

http://forums.thedar...e-6#entry246990


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

http://www.indiedb.c...ds/the-dark-mod

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

#8107 ERH+

ERH+

    Advanced Member

  • Member
  • PipPipPip
  • 711 posts

Posted 16 March 2018 - 01:47 PM

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

http://forums.thedar...aze#entry295696

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+, 16 March 2018 - 01:54 PM.

S2wtMNl.gif


#8108 RPGista

RPGista

    Advanced Member

  • Member
  • PipPipPip
  • 1563 posts

Posted 16 March 2018 - 04:34 PM

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.



#8109 Obsttorte

Obsttorte

    Scripting guru, Mapper

  • Active Developer
  • PipPipPipPipPip
  • 5653 posts

Posted 16 March 2018 - 06:40 PM

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
WIP's: Several. Although after playing Thief 4 I really wanna make a city mission.
Mapping and Scripting: Apples and Peaches
Sculptris Models and Tutorials: Obsttortes Models
My wiki articles: Obstipedia
Let's Map TDM YouTube playlist: ObstlerTube
Texture Blending in DR: DR ASE Blend Exporter

End of shameless self promotion.

#8110 ERH+

ERH+

    Advanced Member

  • Member
  • PipPipPip
  • 711 posts

Posted 17 March 2018 - 12:53 AM

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


#8111 Obsttorte

Obsttorte

    Scripting guru, Mapper

  • Active Developer
  • PipPipPipPipPip
  • 5653 posts

Posted 17 March 2018 - 03:54 AM

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);
...

  • RPGista and ERH+ like this
FM's: Builder Roads, Old Habits, Old Habits Rebuild
WIP's: Several. Although after playing Thief 4 I really wanna make a city mission.
Mapping and Scripting: Apples and Peaches
Sculptris Models and Tutorials: Obsttortes Models
My wiki articles: Obstipedia
Let's Map TDM YouTube playlist: ObstlerTube
Texture Blending in DR: DR ASE Blend Exporter

End of shameless self promotion.

#8112 teh_saccade

teh_saccade

    Advanced Member

  • Member
  • PipPipPip
  • 630 posts

Posted 17 March 2018 - 09:10 AM

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.



#8113 Bienie

Bienie

    Member

  • Member
  • PipPip
  • 195 posts

Posted 18 March 2018 - 01:24 PM

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).



#8114 Bikerdude

Bikerdude

    Mod hero

  • Member
  • PipPipPipPipPip
  • 20064 posts

Posted 18 March 2018 - 03:15 PM

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.



#8115 Obsttorte

Obsttorte

    Scripting guru, Mapper

  • Active Developer
  • PipPipPipPipPip
  • 5653 posts

Posted 18 March 2018 - 03:21 PM

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
WIP's: Several. Although after playing Thief 4 I really wanna make a city mission.
Mapping and Scripting: Apples and Peaches
Sculptris Models and Tutorials: Obsttortes Models
My wiki articles: Obstipedia
Let's Map TDM YouTube playlist: ObstlerTube
Texture Blending in DR: DR ASE Blend Exporter

End of shameless self promotion.

#8116 Bienie

Bienie

    Member

  • Member
  • PipPip
  • 195 posts

Posted 18 March 2018 - 04:37 PM

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?



#8117 Obsttorte

Obsttorte

    Scripting guru, Mapper

  • Active Developer
  • PipPipPipPipPip
  • 5653 posts

Posted 18 March 2018 - 04:39 PM

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
WIP's: Several. Although after playing Thief 4 I really wanna make a city mission.
Mapping and Scripting: Apples and Peaches
Sculptris Models and Tutorials: Obsttortes Models
My wiki articles: Obstipedia
Let's Map TDM YouTube playlist: ObstlerTube
Texture Blending in DR: DR ASE Blend Exporter

End of shameless self promotion.

#8118 R Soul

R Soul

    Member

  • Member
  • PipPip
  • 139 posts

Posted 18 March 2018 - 05:54 PM

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, 18 March 2018 - 06:47 PM.


#8119 Judith

Judith

    Advanced Member

  • Member
  • PipPipPip
  • 1425 posts

Posted 19 March 2018 - 01:13 AM

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.



#8120 Springheel

Springheel

    Creative Director (retired)

  • Admin
  • 37326 posts

Posted 19 March 2018 - 02:21 PM

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.


TDM Missions:   A Score to Settle   *   A Reputation to Uphold   *   A New Job   *    A Matter of Hours
 
Video Series:   Springheel's Modules   *   Speedbuild Challenge   *   New Mappers Workshop  *   Building Traps

#8121 R Soul

R Soul

    Member

  • Member
  • PipPip
  • 139 posts

Posted 19 March 2018 - 05:26 PM

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.



#8122 ERH+

ERH+

    Advanced Member

  • Member
  • PipPipPip
  • 711 posts

Posted 19 March 2018 - 05:52 PM

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


#8123 ERH+

ERH+

    Advanced Member

  • Member
  • PipPipPip
  • 711 posts

Posted 25 March 2018 - 02:36 PM

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


#8124 Obsttorte

Obsttorte

    Scripting guru, Mapper

  • Active Developer
  • PipPipPipPipPip
  • 5653 posts

Posted 25 March 2018 - 02:49 PM

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
WIP's: Several. Although after playing Thief 4 I really wanna make a city mission.
Mapping and Scripting: Apples and Peaches
Sculptris Models and Tutorials: Obsttortes Models
My wiki articles: Obstipedia
Let's Map TDM YouTube playlist: ObstlerTube
Texture Blending in DR: DR ASE Blend Exporter

End of shameless self promotion.

#8125 Judith

Judith

    Advanced Member

  • Member
  • PipPipPip
  • 1425 posts

Posted 31 March 2018 - 08:23 AM

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, 31 March 2018 - 09:02 AM.




Reply to this topic



  


1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users