Module system for version 0.731

正在查看此主题的用户

armagan

Developer
Hi Folks,

I uploaded the module system for version 0.731 on our server. You can grab it from the link below:

www.taleworlds.com/download/mb_module_system_0731_0.zip

Some of the many changes include:

Added pf_no_label flag to parties which makes a party not display a label (Thanks to Thorgrim for suggesting this!)
Added store_random_in_range and store_attribute_level commands. Thanks a lot to Khalid Ibn Valid and Winter for their suggestions.
New module file: scene_props.txt you need to copy this over to your module.
New module file: particle_systems.txt you need to copy this over to your module.
New module file: sounds.txt you need to copy this over to your module.
New module file: simple_triggers.txt you need to copy this over to your module.
There is no limit on number of variables anymore.
Changed map_icons file format. The new format requires id and flags fields.
Added scan_module_sounds directive.


You must add the following lines to module_info.txt
load_resource = grass_meshes
load_resource = plant_meshes
load_resource = xtree_meshes
load_resource = town_houses
load_resource = helpers
load_resource = weapon_meshes_b
load_resource = doors
load_resource = churches

Also there have been lots of changes to mission_templates, so I suggest you use the official version for this.

One of the most powerful new features intrroduced in the new version is the abillity to attach pieces of data to game objects. The attachments are called "slots". You can put any number inside them. For example troop_set_slot and troop_get_slot commands let you attach and retrieve data to troop objects. Suppose you want to keep track of which NPCs the player has met with. Let's assume you decide that, say the seventh slot will hold "1" if player has spoken to an NPC and "0" otherwise (all slots are initially set to 0) . Then whenever we speak to an NPC you'll set the seventh slot with

插入代码块:
(store_conversation_troop, reg(1)),
(troop_set_slot, reg(1), 7, 1),

Then whenever we want to check if we have talked with this NPC before, we may use:

插入代码块:
(store_conversation_troop, reg(1)),
(troop_get_slot,reg(5),  reg(1), 7),
(eq, reg(5), 1),

There is no practical limiti to the number of slots you can use, but note that if you assign to a slot 10000, all slots from 0 to 10000 will be created. So try to use the slots with lowr numbers.

I guess that's it for now. I hope you won't have too much trouble porting existing mods. I'll be around if you need to ask any questions. :grin:
 
Thorgrim: Thanks a lot. Looking forward to what you'll cook up next :smile:

Yoshiboy 说:
awesome! I cant wait! Is there a teleport command for the world map?
Sort of. You can teleport a party to or near another party. (Of course towns count as parties)
 
the towns are now hardcoded, does that mean we cant add towns with the same properties (sneak in etc etc)??
 
Ah, cool deal. That was quick. Wish I had time right now to check out the changes. :sad:

I'll definitely check them out thoroughly later in the weekend though and work on porting my Arena Expansion over.
 
Yoshiboy 说:
the towns are now hardcoded, does that mean we cant add towns with the same properties (sneak in etc etc)??

You can add new towns. You'll just need to set the necessary slots with party_set_slot (along with the other towns in one of the triggers at the beginning of module_triggers.py) If anything, creating new towns is easier now. :grin:
 
SQUEE! Now the real fun begins.

There's a simple method of scripted troop movement in the castle-attack mission template... very very nice.

插入代码块:
agent_set_scripted_destination

Now we can make troops move around obstacles in pre-planned paths.

You could probably make guards patrol a set course with this, too...

插入代码块:
scene_prop_disable

Cool, no more needing to use entirely different versions of scenes for a few small changes.

插入代码块:
ti_on_leave_area

And right there is the ability to deal with running away prematurely. And to think I worked so hard to kludge this for Storymod, and now it's just a simple trigger option.

Excellent work, devs!
 
hey, armie, I did exactly (I think) what you said and I got this error (also had to remove the load_resource=texture_names line from module_info.txt)
---------------------------
RGL ERROR
---------------------------
get_object failed for: comic_sans
---------------------------
OK
---------------------------
EDIT: nm I made it run... though everything seems pretty much screwed :razz:
 
Well, I couldn't help myself. I went ahead and peered into the files even though I shouldn't right now.

The two new item fields are a big addition looking at the flintlock pistol's entry. So we can add our own sounds and particles which a specific weapon will show/play when it's used. Very nice indeed. That will be quite useful in the Age of Ash mod, and as anotehr example I know the Jedi mod will find both of those handy.

Oh, and those people who were wanting bowstring sounds? From what I see they could be added to one or all bows/crossbows when they fire.

Somebody wants a magical blade that has fire or smoke coming from it, or perhaps dripping ice crystals? Want that weapon to flare up when you swing it? A blade that screams/hums/etc. when you swing it? Should all be possible.

Cool stuff. I've been sufficiently distracted from what I should actually be doing now. :razz:
 
And further, it appears you can use the particles and sounds in any operation block, not just ones attached to weapons or scene props.

Here's something that's really cool which I've been looking forward to: you can now loop through troops on the battlefield in the mission templates and check various things about them, then set their AI script based on where they are and how close they are to certain points in the scene. Those are in the siege script in mission templates. So, a lot more stuff to play with in the mission templates to determine what's actually going on in the battle.

I'm also imagining having it track each KO in an arena fight and play some crowd noise (cheers, boos) based on that. Might be a little odd with no crowd visible, but still... many possibilities from being able to play a sound you've added in any operation block.

EDIT: by the way, a bug slipped through, the one that has some training fights set the opponent up as a friendly. It's the team set for lines 278/279 of module_mission_templates.py.
 
Janus 说:
EDIT: by the way, a bug slipped through, the one that has some training fights set the opponent up as a friendly. It's the team set for lines 278/279 of module_mission_templates.py.
I just realized something else important that changed for anyone who has made their own mission templates. There were previously (.711 and back) 5 teams available, team 0 through team 4, but team 0 has been removed now and missions which use team designation were modified accordingly. So if you're porting over to the new module system, be sure to change that in your mission templates if you have done any editing there. No more team 0.
 
This slot thing seems quite powerful. Lot of changes needed to adapt to it, but I think I'm beginning to get it.

Heh, heh. My "Making New Towns - a primer" needs to be completely overhauled.
 
I've been scanning through the header_operations file, since these are tools that make the mods go. Some questions:

1) What are agents? How are they used?

More later...
 
Check in module_mission_templates and look for the castle siege mission. The term "agents" refers to troops on the battlefield which we now have more access to. Armagan seems to be using it for AI waypoint setting at the moment to make the little buggers follow set paths. Pretty damn cool stuff.
 
Here's a heads-up for all you modders out there, something I just encountered in porting Storymod -- all your terrain codes now generate completely different terrain than they did in 0.711. This makes all existing terrain code/scene object combinations useless.

I've certainly got my work cut out for me. Funnn...

Inelegantly,
Winter
 
Yeah, I found that out myself. On the upside, the terrain generator has new options to make generating just the right terrain easier.
It now has a "vegetation" slider that goes from no trees/bushes/etc. to a veritable forest. So no more playing around with the seed trying to get as little vegetation as possible.
Also, copy and paste both work in it, so you can store, retrieve, and check previously stored terrains. Cool beans.
 
后退
顶部 底部