Modding Q&A [For Quick Questions and Answers]

Users who are viewing this thread

Status
Not open for further replies.
Naw, I got it (finally).

Firstly, thus:

Call this script in a ti_after_mission_start triggered mission_templates block:

Code:
  #This script sets all mounted Agents using the Cavalry slot to use missile weapons.
   ("mounted_agent_ai_initial_orders",
  [ 
	(try_for_range, ":team", 0, 5),
		(team_give_order, ":team", grc_cavalry, mordr_use_ranged_weapons),
		(team_give_order, ":team", grc_cavalry2, mordr_charge),
	(try_end),
  ]), 
That sets the Cavalry Division to use ranged weapons, which triggers the "horse archer" behaviors in any Agent that possesses a missile weapon, whether or not it has ammo at all.  Unfortunately, it also triggers some sort of state-machine lockup, where it simply will not return to using its melee weapon even if it doesn't have any ammo left and will not respond to melee attacks (weirdly, it would if it still had ammo...).

Then, in a cyclic block:

Code:
  #This script forces Agents that are horse-archers and no longer have any ammo...
  #...to be moved into the Cavalry2 Division, which always defaults to Charge mordr.
  #This prevents the Agents from sitting around doing nothing.  Will hopefully be fixed in-engine by TW per bug report 4105.
     ("cf_mounted_agent_ai_fixer",
  [ 
	(try_for_agents, ":agent"),
		(agent_is_human, ":agent"),
		(agent_is_alive, ":agent"),
		(agent_is_active, ":agent"),
		(agent_get_troop_id, ":id", ":agent"),
		(neq, ":id", "trp_player"),
		(agent_get_ammo, ":ammo", ":agent", 1),
		(agent_get_division, ":division", ":agent"),
		(agent_get_team,":agent_team", ":agent"),
		(team_get_movement_order, ":order_type", ":agent_team", grc_cavalry),
		(try_begin),
			(lt, ":ammo", 1),
			(eq, ":division", grc_cavalry),		
			(eq, ":order_type", mordr_charge),
			(agent_set_division, ":agent", grc_cavalry2),
		(try_end),
	(try_end),
  ]), 
This kicks all Agents in grc_cavalry that do not have ammo left into another Division, whose default mordr state is mordr_charge, if, and only if, they do not have any ammo and grc_cavalry's mordr state is currently mordr_charge.  I had a horse check and other stuff in there, but frankly, it's a waste of CPU (not that this one's terribly expensive, since the Division handoff is one-time, one-way); if we've told the cavalry to charge, then we want the right behavior; if players wish to give different orders to grc_cavalry2, they can do so without upsetting the script logic in any way.

grc_cavalry2 is, IIRC, a non-standard module_constants designation, but it's Division 8, if anybody just wants to use the raw number.
 
This is part of my force shield saga: I want to add a semi-transparent (smooth alpha) texture on a sphere (hexagonal pattern etc. looking all sci fi). Aaaaand it won't work.

So, OpenBRF it either sees it as opaque or transparent below a given threshold (the Alpha test: <136/256 thingy), thus splitting the texture between a totally opaque area and a totally transparent area.

How can I make it so that it will give me a smooth transparency? I have tried a ton of shaders and settings. I am using the dxt5 (smooth alpha) saved with the nvidia plugin for photoshop. And yes, I have searched the forums for this, but people ask for sharp transparency usually.


 
Any idea what causes this and how to fix it?
I fixed (i think) a series of indentation errors only to get this
ZdzY360.png
 
I use blend, spec RGB 5 5 5, coefficient 6, flags C000100 (blend and render order -4) aaaaaand won't work :neutral:

I tried simple_shader and specular_shader_skin_bump_high and a bunch of others (I'd like to make the shield bubble a little shiny also). But to no avail. Maybe there's something wrong when I make the texture in PS. Should I add a separate alpha channel or having all merged layers transparent will do the trick? The alpha channel is all well and nice in the material and texture menus in openBRF, so I think my method is ok...

PS: Willhelm please use the SPOILER thingy for your pictures. Thanks!
 
Someone knows if there is a way to bypass the agent body by another agent? I mean, is there a way to disable the collide between agents, or a workaround?

I think it's impossible.
 
@Daviduh:  You must have an alpha defined in your diffuse texture, as well as enabling alpha blending in your Material.  Be warned; this engine was not designed to handle translucent materials, and you may see all kinds of order-of-rasterization artifacts as a result, if a lot of these shields are going to be seen overlapping one another.

@CTCCoco:  Well, you could force the Agent to move to a new position on the other side of the Agent.  Or you could define a new Race that's basically just like humans but with the collision meshes all turned off, and switch the Race of the Agent.  I can't think of anything else to try, though, and both things come with some issues.
 
xenoargh said:
@Daviduh:  You must have an alpha defined in your diffuse texture, as well as enabling alpha blending in your Material.  Be warned; this engine was not designed to handle translucent materials, and you may see all kinds of order-of-rasterization artifacts as a result, if a lot of these shields are going to be seen overlapping one another.

@CTCCoco:  Well, you could force the Agent to move to a new position on the other side of the Agent.  Or you could define a new Race that's basically just like humans but with the collision meshes all turned off, and switch the Race of the Agent.  I can't think of anything else to try, though, and both things come with some issues.

Thank you, sir !
 
Hello I have a question regarding entry points when you create a new castle/town scene

I've read the tutorials and it states that 1-32 are defenders and 32-64 are attackers.  It seems that some of the town walkers use entry points higher than 32 though.

I have my new town scene all created and was wondering if someone could give me some tips for setting up entry points.

Thanks.
 
Those are MP entry points, the SP entry points are different.
Check these or do a search:
http://forums.taleworlds.com/index.php/topic,260147.0.html
http://forums.taleworlds.com/index.php/topic,62408.msg1618699.html#msg1618699
 
xenoargh said:
@Daviduh:  You must have an alpha defined in your diffuse texture, as well as enabling alpha blending in your Material.  Be warned; this engine was not designed to handle translucent materials, and you may see all kinds of order-of-rasterization artifacts as a result, if a lot of these shields are going to be seen overlapping one another.

Still giving me the sharp alpha. I might have to change the texture, no big problem, just annoying that it won't work as I want it to :smile:
 
I created new spawn points-parties following this tutorial

http://forums.taleworlds.com/index.php/topic,53192.0.html

The parties are spawning at six locations(six spawning points),but there a not a lot of their parties on the map.
How to increase their number?

module_scripts.py

(try_begin),
      (store_num_parties_of_template, ":num_parties", "pt_youth_brigades"),
      (lt,":num_parties",300),
      (store_random,":spawn_point",num_youth_sp),
      (val_add,":spawn_point","p_youth_sp_1"),
      (spawn_around_party,":spawn_point","pt_youth_brigades"),
    (try_end),
 
It takes time, that script only runs when it's activated by a trigger.

You could always do this to speed things up, if you're just testing stuff:

Code:
(try_begin),
(try_for_range, ":unused", 1, 50),
       (store_num_parties_of_template, ":num_parties", "pt_youth_brigades"),
       (lt,":num_parties",300),
       (store_random,":spawn_point",num_youth_sp),
       (val_add,":spawn_point","p_youth_sp_1"),
       (spawn_around_party,":spawn_point","pt_youth_brigades"),
(try_end),
     (try_end),

I wouldn't leave it that way, though, there are much better ways to adjust the total population of Parties :lol:
 
xenoargh said:
It takes time, that script only runs when it's activated by a trigger.

You could always do this to speed things up, if you're just testing stuff:

Code:
(try_begin),
(try_for_range, ":unused", 1, 50),
       (store_num_parties_of_template, ":num_parties", "pt_youth_brigades"),
       (lt,":num_parties",300),
       (store_random,":spawn_point",num_youth_sp),
       (val_add,":spawn_point","p_youth_sp_1"),
       (spawn_around_party,":spawn_point","pt_youth_brigades"),
(try_end),
     (try_end),

I wouldn't leave it that way, though, there are much better ways to adjust the total population of Parties :lol:

WOW!
They are now all around the map,A LOT of them.
EXACTLY what I needed.
Thank you.

Now lords will never be the chief army (youth brigades have 500 troops in each party :grin: )
 
I have another question regarding setting up my scene.  When I originally made it, I edited the Exterior scene and then realized that this was not the siege scene, so I replaced the Town Walls scene with the Exterior scene.  My issue is the elevations/terrain in the Town Walls scene did not change to match those of the scene I created.

Any tips?

Thanks
 
Hey..Does anyone know how to assign flagbearer map icons for each factions..I know TLD has done it.. But I couldn't find how in their Module System.. I've made flagbearer map icons for every faction but I have no idea how to assign them properly.
 
Status
Not open for further replies.
Back
Top Bottom