Modding Q&A [For Quick Questions and Answers]

Users who are viewing this thread

Status
Not open for further replies.
NPC99 said:
Wendepoz said:
Hello, I'm trying to make it so that when the player falls in battle he controls another agent and this is what I have so far (I'm using lua) :

function ChangePlayerAgent()
local player = game.get_player_agent_no(0)
local deadAgent = game.store_trigger_param(0, 1)

if deadAgent == player then
local newPlayerAgent

for agent in game.agentsI() do
if game.agent_is_ally(agent) and game.agent_is_human(agent) and game.agent_is_alive(agent) then
newPlayerAgent = agent
break
end
end

if newPlayerAgent ~= nil then
local playerID = game.agent_get_player_id(0, player)
game.player_control_agent(playerID, newPlayerAgent)
game.display_message("Set new player agent")
else
game.display_message("Couldn't find agent for player")
end
end
end

game.addTrigger("mst_lead_charge", game.const.ti_on_agent_killed_or_wounded, 0, 0, returnTrue, ChangePlayerAgent)

I'm almost certain that the cause of the problem is that I'm using "player_control_agent" which is for multiplayer but I can't find an equivalent for singleplayer. Does anybody know how to make this work?

I can’t help with lua, but the Twilight of the Sun King mod’s source code is OSP & includes body sliding for singleplayer - look at their auxilliary triggers in mission_templates.py.

Thanks, I'll check it out
 
Wendepoz said:
Efe Karacar said:
(set_player_troop, <troop_id>),

@Wendepoz

I tried it but it doesn't work, after the battle in changes the referenced troop's equipment and stats to the same as the player's and bugs out.

There are codes that govern that, check Custom Commanders OSP.
 
So, I kill the agent with the following code:
Code:
(agent_deliver_damage_to_agent, ":agent_no", ":agent_no", 100),
But in some cases, the agent does not die, but falls unconscious.
And how can I find out if the agent died or was wounded after this command was executed? :?: :?: Please, help.
 
PitchPL said:
Code:
(agent_is_wounded, <agent_id>),
I can be mistaken but you can try use above operation to filter them after using (agent deliver damage and do whats you need with them.
I don't have IDE installed currently so I can't check that.
Thank you. It works.
 
Janycz said:
Thank you. It works.

make sure to put that code inside this trigger: "ti_on_agent_killed_or_wounded", you can then use the operation "set_trigger_result" to change the result

Code:
ti_on_agent_killed_or_wounded = -26.0 # Agent has been defeated in battle (killed or wounded)
    # trigger param 1 = defeated agent_id
    # trigger param 2 = attacker agent_id
    # trigger param 3 = wounded flag: 0 = agent is killed, 1 = agent is wounded
    # If (set_trigger_result) with non-zero parameter is used in the code, it will override the agent's fate. Use value of 1 to force kill, and 2 to force wounded.

 
kalarhan said:
make sure to put that code inside this trigger: "ti_on_agent_killed_or_wounded", you can then use the operation "set_trigger_result" to change the result
Thank you. In my script, it was easier to do needed feature through this trigger. But I will not rewrite it. But I do not need to change the result. I just had to correctly display the message: 'X died from bleeding'. or 'X fell unconscious from bleeding'.
 
I noticed on the Jailbreak server that certain commands are triggered upon entering something like /help into the chat. Does anyone know how you would go about coding something like this?
 
pete99 said:
I noticed on the Jailbreak server that certain commands are triggered upon entering something like /help into the chat. Does anyone know how you would go about coding something like this?
The server runs WSE then.
It allows to catch the in-game chat and provides plenty of additional string operations.
 
Hello. I see where this could easily be one of those answers right under my nose, but I'm feeling stuck on a what I think is a multimesh problem. I wanted to try importing a couple of the lances with banners from the Sands of Faith mod, but the banners always end up being solid white. The texture/mesh loads up fine for the lance itself; it's just the banner that has the problem.

I'd copied the BRF file for the banner lances into the new Resource folder and it is in the module.ini file to be loaded. I also checked that everything was correctly named for multimesh. Seemed like it should be since, of course, it works in its own environment, but I figured I'd be sure. That looked fine. The lance itself is named "spear_baner_templar_a", for example, with the additional three meshes being named the same with the number following the period, i.e. "a.1", "a.2", and "a.3".

I checked the lance I was trying to add versus the original lance in the Sands of Faith mod in Morgh's Editor. I have all the flags set up the same way, from what I can see. I had also read that the texture has to be loaded first for a multimesh. The textures are included inside of the BRF file, so I did not think this was the problem. Just in case, though, I also added them to a texture BRF that is loaded before the BRF file with the multimesh in it. Didn't work either way. I have also tried making sure the shaders BRF was included in the folder and set up to load early in the .ini file.

Open BRF finds the texture files without a hitch and its reporting that the meshes and textures are being used. Even so, once I load up the game, the banners will still be solid white there. Starting new games each time I check just to be sure everything is loading new. Is there something else I could be missing here? Has anyone here tried to use or succeeded in using the SoF lances with the banners on them?
 
RobSmith176 said:
Hello. I see where this could easily be one of those answers right under my nose, but I'm feeling stuck on a what I think is a multimesh problem. I wanted to try importing a couple of the lances with banners from the Sands of Faith mod, but the banners always end up being solid white. The texture/mesh loads up fine for the lance itself; it's just the banner that has the problem.

I'd copied the BRF file for the banner lances into the new Resource folder and it is in the module.ini file to be loaded. I also checked that everything was correctly named for multimesh. Seemed like it should be since, of course, it works in its own environment, but I figured I'd be sure. That looked fine. The lance itself is named "spear_baner_templar_a", for example, with the additional three meshes being named the same with the number following the period, i.e. "a.1", "a.2", and "a.3".

I checked the lance I was trying to add versus the original lance in the Sands of Faith mod in Morgh's Editor. I have all the flags set up the same way, from what I can see. I had also read that the texture has to be loaded first for a multimesh. The textures are included inside of the BRF file, so I did not think this was the problem. Just in case, though, I also added them to a texture BRF that is loaded before the BRF file with the multimesh in it. Didn't work either way. I have also tried making sure the shaders BRF was included in the folder and set up to load early in the .ini file.

Open BRF finds the texture files without a hitch and its reporting that the meshes and textures are being used. Even so, once I load up the game, the banners will still be solid white there. Starting new games each time I check just to be sure everything is loading new. Is there something else I could be missing here? Has anyone here tried to use or succeeded in using the SoF lances with the banners on them?

The shaders BRF is just a reference, which needs the related shader file to work. If the pennants are animated, they will rely upon non-native fxo shader files.
 
NPC99 said:
RobSmith176 said:
Hello. I see where this could easily be one of those answers right under my nose, but I'm feeling stuck on a what I think is a multimesh problem. I wanted to try importing a couple of the lances with banners from the Sands of Faith mod, but the banners always end up being solid white. The texture/mesh loads up fine for the lance itself; it's just the banner that has the problem.

I'd copied the BRF file for the banner lances into the new Resource folder and it is in the module.ini file to be loaded. I also checked that everything was correctly named for multimesh. Seemed like it should be since, of course, it works in its own environment, but I figured I'd be sure. That looked fine. The lance itself is named "spear_baner_templar_a", for example, with the additional three meshes being named the same with the number following the period, i.e. "a.1", "a.2", and "a.3".

I checked the lance I was trying to add versus the original lance in the Sands of Faith mod in Morgh's Editor. I have all the flags set up the same way, from what I can see. I had also read that the texture has to be loaded first for a multimesh. The textures are included inside of the BRF file, so I did not think this was the problem. Just in case, though, I also added them to a texture BRF that is loaded before the BRF file with the multimesh in it. Didn't work either way. I have also tried making sure the shaders BRF was included in the folder and set up to load early in the .ini file.

Open BRF finds the texture files without a hitch and its reporting that the meshes and textures are being used. Even so, once I load up the game, the banners will still be solid white there. Starting new games each time I check just to be sure everything is loading new. Is there something else I could be missing here? Has anyone here tried to use or succeeded in using the SoF lances with the banners on them?

The shaders BRF is just a reference, which needs the related shader file to work. If the pennants are animated, they will rely upon non-native fxo shader files.

Shoot, I knew it would end up being something small. Thank you very much. That took care of it.
 
Yoshiboy said:
Eogan said:
Darnit!  I had enough trouble learning Effidian's editor, and now I've got to figure out Python. :/

So... how do I import all the work I've already done into the ModuleSystem folder?  Having to do it all over again would probably be a deal-breaker at this point.

no way atm....

It's 2018 now and this is the first time I've seen this question posed in the Q&A post of 1000+ pages. So to ask the question again, is it possible to load an existing mod into a freshly downloaded version of the Official Warband Module System v1.171?
 
dbteepo said:
Yoshiboy said:
Eogan said:
Darnit!  I had enough trouble learning Effidian's editor, and now I've got to figure out Python. :/

So... how do I import all the work I've already done into the ModuleSystem folder?  Having to do it all over again would probably be a deal-breaker at this point.

no way atm....

It's 2018 now and this is the first time I've seen this question posed in the Q&A post of 1000+ pages. So to ask the question again, is it possible to load an existing mod into a freshly downloaded version of the Official Warband Module System v1.171?

A mod is an output of the Module System. Generally, you can't get back the source from a projection without loss.

Current Native is just a mod of its previous version. So, if you somehow got the Module System of that old mod - probably from its author - then you have to merge the two Module Systems before extracting the refreshed mod. I don't know any automated routine how to logically organize two separatly modified group of functions. I fear, that "no way" is still standing.

P.S.:
Hey, my forum rank dropped!! How to deal with beeing demoted? Sorry me  :cry:.
 
Is there some way to get rid of the "[] killed a teammate!" and replace it with an ordinary kill message? I had a look in strings, and there doesn't appear to be any specific text for this particular message. Is it located somewhere else, or somehow hard-coded into the game?
 
pete99 said:
Is there some way to get rid of the "[] killed a teammate!" and replace it with an ordinary kill message?

language folder ui.csv



dbteepo said:
is it possible to load an existing mod into a freshly downloaded version of the Official Warband Module System v1.171?

if you have the mod source (modsys) you need to update (replace/merge) the engine files (header_XXX.py), and check any bug fixes included on the normal files (module_XXX.py) or new features. As Native has not got any updates for years on the SP side, unless you are working with MP or a ancient mod (think before 1.153) then it should be a quick job.
 
Status
Not open for further replies.
Back
Top Bottom