Jump to content


Photo

Newbie DarkRadiant Questions


8689 replies to this topic

#8276 Dragofer

Dragofer

    Modeler

  • Member
  • PipPipPip
  • 607 posts

Posted 19 August 2018 - 07:06 AM

The call comes directly from the trigger_touch.

Excellent, that's all I still needed. I forgot trigger brushes themselves can call scripts.

I've got a working setup now, attached it here. Brief description:

- This teleports the player and other entities, but not AI and func_static, between 2 locations.

- At each end there's a trigger_entityname brush (entityname: player1) and a trigger_touch. The trigger_entityname should be well within the trigger_touch.

 

- The player walks into the trigger_entityname brush. This calls a script which for a split-second actives the large trigger_touch brush, which registers all entities within its volume.

- Each entity that's not a func_static is teleported. The vector of the teleport is defined at the top of the script, i.e. '0 200 0' units.

 

 

Some limitations:

1) the moveables do flash briefly, even if it's just a single crate, despite my efforts to keep the per-moveable script as short and simple as possible.
2) grabbed and dragged items only get teleported if they're within the trigger_touch. They could be added to the script as well, but I suspect this would visibly slow down its execution. This can be worked around by placing the initial trigger well within the trigger_touch.
3) when I teleported an AI via the trigger_touch he disappeared. Maybe I did something wrong, but I was going to use an AI-free antechamber in any case to avoid opening what's almost certainly a can of worms.
4) having moveables within the trigger_touch at mapstart may sometimes be problematic because the first teleportation activates their physics, potentially setting them in motion. This is fine if they're positioned in an orderly manner.

Attached Files


Edited by Dragofer, 07 January 2019 - 10:34 AM.


#8277 JackFarmer

JackFarmer

    Member

  • Member
  • PipPip
  • 249 posts

Posted 19 August 2018 - 12:13 PM

Walking_on_water.jpg

 

All additional entities are bind to the func pendulum.

 

As long as I do not add an AI, all entities (including the func pendulum itself) bob up and down as I want it.

 

If I bind the AI to the pendulum, then the AI vanishes.

If I leave the AI as it is and just bind the rest of the entities to the func pendulum, then the effect does not appear and the boat and all other stuff within it show the regular immobile behaviour.

 

Does the setup as depicted in the image only work with static entities?


Edited by JackFarmer, 19 August 2018 - 12:16 PM.


#8278 Springheel

Springheel

    Creative Director (retired)

  • Admin
  • 37754 posts

Posted 19 August 2018 - 12:17 PM

Binding AI to something is probably not the way to go if you want them to be able to do anything.  If the AI doesn't need to move or interact, using an ambient AI is probably better.  If they do, I would put a wood collision brush under the AI and bind that to the func_pendulum, and just let the AI stand on it.


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

#8279 JackFarmer

JackFarmer

    Member

  • Member
  • PipPip
  • 249 posts

Posted 19 August 2018 - 01:20 PM

Sorry Springheel, I did not put it correctly.

 

The person shall not interact but the person shall sit in the boat and hold a book, and everything shall bob up and down:

 

boat2.jpg

 

Can this be done as well? What is an ambient AI? I cannot find this term in the Wiki and (as far as I can see) there is no related folder in DR.



#8280 Obsttorte

Obsttorte

    Scripting guru, Mapper

  • Active Developer
  • PipPipPipPipPip
  • 5823 posts

Posted 19 August 2018 - 01:23 PM


I would put a wood collision brush under the AI and bind that to the func_pendulum, and just let the AI stand on it.

This can still lead to issues with pathfinding if the bobbing is strong enough.

 

Generally only static entities or articulated figures (like ropes) should be bound to moving entities, but the latter only if the movement isn't too strong.


If I leave the AI as it is and just bind the rest of the entities to the func pendulum, then the effect does not appear and the boat and all other stuff within it show the regular immobile behaviour.

The ai is probably blocking the movers. Check the inherited spawnargs.


What is an ambient AI?

an articulated figure that can run animations (like ai) but does not think (unlike ai). Thinking means pathfinding, alert system, physics etc...


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.

#8281 Obsttorte

Obsttorte

    Scripting guru, Mapper

  • Active Developer
  • PipPipPipPipPip
  • 5823 posts

Posted 19 August 2018 - 01:25 PM


What is an ambient AI? I cannot find this term in the Wiki and (as far as I can see) there is no related folder in DR.

 

http://wiki.thedarkm..._static_objects


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.

#8282 Springheel

Springheel

    Creative Director (retired)

  • Admin
  • 37754 posts

Posted 19 August 2018 - 01:43 PM

Sorry Springheel, I did not put it correctly.

 

The person shall not interact but the person shall sit in the boat and hold a book, and everything shall bob up and down:

 

Can this be done as well? What is an ambient AI? I cannot find this term in the Wiki and (as far as I can see) there is no related folder in DR.

 

If you add entity and go to AI/Ambient, you can try one of the "audience" entities.  They're already set up to be sitting down (you may need to attach the head separately).


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

#8283 duzenko

duzenko

    Uber member

  • Active Developer
  • PipPipPipPip
  • 2278 posts

Posted 23 August 2018 - 04:53 PM

Sorry, I couldn't find a better thread to ask.

I want to test rendering of a particular material (textures/water_source/sea_wave_01) but I'm clueless with DR. How can I find an existing mission that uses that material?



#8284 Dragofer

Dragofer

    Modeler

  • Member
  • PipPipPip
  • 607 posts

Posted 24 August 2018 - 03:29 PM

Sorry, I couldn't find a better thread to ask.
I want to test rendering of a particular material (textures/water_source/sea_wave_01) but I'm clueless with DR. How can I find an existing mission that uses that material?


I know that nbohr1more and some others have a method of searching for keywords in all mission packages. In this case you'd find the material name within the .map file if it occurs on one of the brushes or patches.

In any case I've thrown that material into a testmap here. The .pk4 version can be treated like a normal fm package, while the .map version can be placed in darkmod/maps and run via console -> testmap test_map. Delete the .txt extension ofc.

Attached Files


  • duzenko likes this

#8285 Bienie

Bienie

    Member

  • Member
  • PipPip
  • 286 posts

Posted 24 August 2018 - 04:15 PM

So I've taken a look and it is possible to pause the animations. Two side effects, though.

  • The timer for the animation is continuing. This means that upon reenabling the animation you would see a clear jump in the anim. As the ai is only supposed to move when not visible, this won't be an issue, though.
  • Pausing the anim stops the transitional movement of the ai (not the rotatory surprisingly, this has to be taken care of additionally), but the code doesn't seem to consider that. This causes the latter to "think" that the path the ai is taking is somehow blocked, causing it to move a bit odd. In this specific usecase this probably isn't an issue either, but it is hard to judge as the implications are hard to foresee.

The command to pause the animation is

	void pauseAnim(float channel, float bPause);

channel is the animation channel to apply the command on. bPause is a boolean that will pause the animation if set to 1, and will unpause it if set to 0. The animation channels are

0 - any (not all, not sure what it is used for)

1 - torso

2 - legs (this stops the movement)

3 - head

4 - eyelids

 

Was going to try and look in to this but I'm having trouble finding the "vanilla" script for AIs that would allow me to make a modified version for my new enemies. I extracted all the .pk4 files but couldn't find anything in the resulting folder structure that contained anything related to AI scripts. Where would I find this? Unfortunately the wiki is very sparse on guidance when it comes to making custom AIs, the closest thing I found was this: http://wiki.thedarkm..._Your_AI_Unique which really only deals with changing AI through spawnargs.



#8286 Obsttorte

Obsttorte

    Scripting guru, Mapper

  • Active Developer
  • PipPipPipPipPip
  • 5823 posts

Posted 24 August 2018 - 04:17 PM

script/tdm_ai_base.script.


  • Bienie 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.

#8287 duzenko

duzenko

    Uber member

  • Active Developer
  • PipPipPipPip
  • 2278 posts

Posted 25 August 2018 - 06:29 AM

I know that nbohr1more and some others have a method of searching for keywords in all mission packages. In this case you'd find the material name within the .map file if it occurs on one of the brushes or patches.

In any case I've thrown that material into a testmap here. The .pk4 version can be treated like a normal fm package, while the .map version can be placed in darkmod/maps and run via console -> testmap test_map. Delete the .txt extension ofc.

Thanks.

 

Is it supposed to be still as it looks to me? The material seems to mention some time-based animation.

It's only glowing with time, but not moving.

 

Could you make that object a separate entity as well? So that other objects don't show with r_singleEntity filter.



#8288 Dragofer

Dragofer

    Modeler

  • Member
  • PipPipPip
  • 607 posts

Posted 25 August 2018 - 03:46 PM

Is it supposed to be still as it looks to me? The material seems to mention some time-based animation.
It's only glowing with time, but not moving.


Something seems to be wrong at your end: for me there are two lines of waves which are translated across the patch's surface.

Here's the test map with a duplicate of both wave patches, this time as entities.

Attached Files


  • duzenko likes this

#8289 JackFarmer

JackFarmer

    Member

  • Member
  • PipPip
  • 249 posts

Posted 26 August 2018 - 02:28 AM

I cannot solve the problem with the objectives: if I complete the objectives in any order, I cannot pick up certain other critical items and thus the remaining objective(s) cannot be completed.

 

ERH+ suggested to remove the objectives entity, save the file under a new name and start from scratch, but the problem remains:

 

console_report.jpg

 

Sometimes this problem start after completion of just one objective, sometimes it starts after completion of two objectives. Why is that and what can I do to fix this?


Edited by JackFarmer, 26 August 2018 - 02:32 AM.


#8290 duzenko

duzenko

    Uber member

  • Active Developer
  • PipPipPipPip
  • 2278 posts

Posted 26 August 2018 - 03:39 AM

I cannot solve the problem with the objectives: if I complete the objectives in any order, I cannot pick up certain other critical items and thus the remaining objective(s) cannot be completed.

 

ERH+ suggested to remove the objectives entity, save the file under a new name and start from scratch, but the problem remains:

 

attachicon.gif console_report.jpg

 

Sometimes this problem start after completion of just one objective, sometimes it starts after completion of two objectives. Why is that and what can I do to fix this?

Are you picking items of the same name and category? If so, it must be "stackable".

Please see the full source code for this action here

https://github.com/d...entory.cpp#L498



#8291 JackFarmer

JackFarmer

    Member

  • Member
  • PipPip
  • 249 posts

Posted 26 August 2018 - 04:53 AM

Hello duzenko,

 

You give me too much credit; I feel flattered but my codings skills are inferior, mildly spoken. :)

 

However:

 

--> the code section you quoted leads to the console report "Cannot put xxx in inventory[...]"

--> my console reports "Couldn't add xxx to inventory of player1"

 

This seems to be something different?

 

The items in question have the same class name but differing individual names. I also tried different class names, but the problem remains.

 

Can I simply add the property "stackable" "1"? I tried that, but it had no effect as well.



#8292 Dragofer

Dragofer

    Modeler

  • Member
  • PipPipPip
  • 607 posts

Posted 26 August 2018 - 06:28 AM

Sometimes this problem start after completion of just one objective, sometimes it starts after completion of two objectives. Why is that and what can I do to fix this?


Are you ever able to pick up all 3 items? If you have no objectives entity are you able to reliably pick up all 3 items? These questions are to track down whether the problem lies with the items or the objectives.

If the objectives cause the problem, and you don't need the items to be moveables which you can throw around, then an alternative would be to let the objectives complete as soon as you frob the items, set up via stim/response to respond to frobbing by triggering a setobjectivestate entity for each objective.

#8293 JackFarmer

JackFarmer

    Member

  • Member
  • PipPip
  • 249 posts

Posted 26 August 2018 - 06:50 AM

Hello Dragofer,

 

You are right; I have never been able to pick up all 3 items till now.

 

I just removed the objective entity and had another try. The problem still occurs and I receive the same console report as in the screenshot posted above.

 

Hm...



#8294 stumpy

stumpy

    Advanced Member

  • Member
  • PipPipPip
  • 1933 posts

Posted 26 August 2018 - 07:04 AM

do the items have the same "inv_name" as you can't pick up more than one item of the same inventory name unless its stackable like loot or projectiles, inventory names have to be unique.

 

stackable items get destroyed and a count of items in a stack increases or decreases, there are not multiple items in a stack, there's just one item. afaik


Edited by stumpy, 26 August 2018 - 07:05 AM.


#8295 JackFarmer

JackFarmer

    Member

  • Member
  • PipPip
  • 249 posts

Posted 26 August 2018 - 07:22 AM

Hello stumpy,

 

You've nailed it; that was the problem, the inv_names were not unique. Problem solved, thanks a lot!


Edited by JackFarmer, 26 August 2018 - 07:23 AM.


#8296 JackFarmer

JackFarmer

    Member

  • Member
  • PipPip
  • 249 posts

Posted 01 September 2018 - 07:31 AM

One of my lazy guards shall carry out the following:

 

1. Sit down

2. Fall to sleep

3. Wait a few seconds and then move to the next path corner.

 

The setup looks as below:

 

Sleeper.jpg

 

1 = path_sit

2 = path_sleep

3 = path_wait with target next path corner

 

Ingame the guard sits down and does nothing else (no sleep, no walk to the next path corner) but uses bad language every once in a while.

 

I don't get it; it is the same setup as with the path anims I've already integrated; I just replaced the latter with sit and sleep pns. What is my mistake? I have already checked the monster clips and made sure that they do not touch the entities.


Edited by JackFarmer, 01 September 2018 - 07:34 AM.


#8297 grayman

grayman

    Master Builder, Coder

  • Active Developer
  • PipPipPipPipPip
  • 12923 posts

Posted 01 September 2018 - 08:55 AM

Do you have "sleep_location/2" set on your path_sleep?


  • Bikerdude and JackFarmer like this

#8298 JackFarmer

JackFarmer

    Member

  • Member
  • PipPip
  • 249 posts

Posted 01 September 2018 - 11:18 AM

Hello grayman,

 

You are not a TDM hero, you are a TDM god.

 

That's it, now it works.  How can I control the sleeping interval of my guard? The inherited list does not include such a property as well.

 

In general: Sometimes there are entities which can be allocated with properties not available in the "inherited" list.

 

Is there some other external list somewhere showing these "hidden" properties for all entities?



#8299 grayman

grayman

    Master Builder, Coder

  • Active Developer
  • PipPipPipPipPip
  • 12923 posts

Posted 01 September 2018 - 11:27 AM

It's controlled by the "wait" spawnarg in the path_wait that follows the path_sleep.

 

For the record, your questions are covered in this section in the Wiki.



#8300 Bikerdude

Bikerdude

    Member

  • Banned
  • PipPipPipPipPip
  • 20320 posts

Posted 01 September 2018 - 12:24 PM

Do you have "sleep_location/2" set on your path_sleep?

Is this info in the wiki somewhere..?





Reply to this topic



  


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users