PYTHON SCRIPT/SCHEME EXCHANGE

Currently Viewing (Users: 0, Guests: 1)

maw

Sergeant Knight at Arms
WB
Best answers
0
Thread Rules:
Exchange Topic Only.
Submit Python code for doing stuff in M&B. Describe your code, what it does.
NO complaints or request for code or help here - just offer an exchange of functional python coded m&b stuff.


AND MY SUBMISSIONS ARE for v731:

1. python for recruiting on map, any pt_ (you'll have to create your own restrictions/limits for recruiting if you want)

2. python for investing in a caravan that, on its own after funding, heads to an random town. if it arrives (assuming its not attacked or destroyed) you receievd your investment + risk bonus based on distance.

3. python for main_party prisoner recruiting, adding to party or releasing to the map

4. promoting a common soldier to Hero-Companion status.

5. camping on the map, to recover injuries

6. python for prisoner interrogation/torture

7. python for a differnt tavern unit recruiting (less code)


remember, please, submissions only - direct all questions or comments to the author by pm. thanx. maw
 

Janus

*spicy* *camper*
Administrator
WBWF&SM&BVC
Best answers
0
Reserving this spot to post my item combination script I made for the Age of Ash mod. Need to update it though now that a few workarounds in it are no longer needed in .731 since those scripting bugs are fixed.
Hmm, might be a while before i have time to go ahead and post this.

Where is Fujiwara's calendar script? It would go well here.

Oh, I also request that each person post in prominent bold letters the module system version their code was made for at the top of their post. Won't be important right now, but will be when new versions come out.
I further submit that people should not hesitate to edit their post as many times as they want to update or correct their listing.

EDIT:
fisheye said:
Oh oh I got one...
Python for making dialogs crash inexplicably in an undebuggable manner.
Sorry, already got that one. Thanks. :razz:
 

sheek

Knight at Arms
WB
Best answers
0
Don't know how useful this stuff is... (all for 0.731)

1/ Python for horse healing/upgrade system (over time). Could easily be modified for other items
2/ Python for constructing a mill/bridge over time - can be adapted for any economic type building
3/ Python for population growth/decrease in reaction to things you've done.
4/ Python for coding additional 'skills' than the Vanilla ones - shown in the Quest window
5/ Python for character development (during character creation) - 'career path' influences starting stats.
 

Angarato

Regular
Best answers
0
Nothing fancy(new features ect.), as I just got the module system. I'll throw up what I have though. Module System version 0.731.0

1. Dark knight parties recruitable from worldmap.

2. New recruitable hero: Calradia's Lord and Saviour Himself, Jesus Christ. Has fair knowlege of various party skills. Decked out with archery gear, greataxe, and charger. Enjoys long walks along Zendar river, slaying infidels, and throwing up the horns. (This one's a bit silly)

 

fisheye

Oh oh I got one...

Python for making dialogs crash inexplicably in an undebuggable manner.
 

Fujiwara

Sergeant at Arms
Best answers
0
By Popular request: The Calendar script!
This was written for .711, but the format hasn't changed any, so it should be .730/.731 friendly

The solar year version:

Code:
(0.0, 0, ti_once, [], [(assign,"$day",1), (assign,"$month",7), (assign,"$year",1)]),

(0.0, 24, 0, [(lt, "$day", 31)], [(val_add,"$day",1)]),
(0.0, 0, 0.0, [(eq,"$day",31),(lt,"$month",13)], [(val_add,"$month",1), (assign,"$day",1)]),
(0.0, 0, 0.0, [(eq,"$month",13)], [(val_add,"$year",1), (assign,"$month",1)]),
and the lunar year version:

Code:
(0.0, 0, ti_once, [], [(assign,"$day",1), (assign,"$month",7), (assign,"$year",1)]),

(0.0, 24, 0, [(lt, "$day", 29)], [(val_add,"$day",1)]),
(0.0, 0, 0.0, [(eq,"$day",29),(lt,"$month",14)], [(val_add,"$month",1), (assign,"$day",1)]),
(0.0, 0, 0.0, [(eq,"$month",14)], [(val_add,"$year",1), (assign,"$month",1)]),
The initial values of $day, $month, and $year can be whatever you want them to be. Enjoy!

EDIT: I also have a script that allows merchant-type characters to sell goods on the open market (so to speak) and not to city merchants, if any one is interested.
 

Yoshiboy

Count
M&BWB
Best answers
0
Ok, i could try to explain how i got land and sea working, basically i will give you a short run down on how its possible, if you want something more specific look at my source:
http://www.warpmod.com/dev/YoshiBoy/pirates_v1.3_source.rar

Ok, reserved for later when i will take a shot at explaining
 

Raybur Ravenloc

Regular
Best answers
0
well, i was thinking it would be nice to have a page full of code snippets with small descriptions of what they do for coders to just slap in their mod
i have something like 10Mb of space for a website, i could use that, and post up whatever code modders send to me via a post here, a PM, or an email
not an HTML master, so it won't be pretty unless someone wants to show me a better example and how to update it

heres what I slapped up in about five minutes (after brushing up on HTML tags)
just used the sample fujiwara put up.. guess i should put credits to him too.. guess i will if anyone actually wants to use this, otherwise i'll just take it down
http://myweb.bloomu.edu/bpdowd/M&Bcode.htm

so what do you think? it can be changed however, this is just something i spent about ten minutes thinking about and putting up
probably would add various pages and organization if it picked up, put up the snippets in whatever format they are given to me or i am asked to put them in..

PS: i'll be away this weekend, youngest brother's first birthday in another state.. be back sunday, might have internet access once or twice between now and then
 

sheek

Knight at Arms
WB
Best answers
0
Raybur Ravenloc said:
well, i was thinking it would be nice to have a page full of code snippets with small descriptions of what they do for coders to just slap in their mod
i have something like 10Mb of space for a website, i could use that, and post up whatever code modders send to me via a post here, a PM, or an email
not an HTML master, so it won't be pretty unless someone wants to show me a better example and how to update it

heres what I slapped up in about five minutes (after brushing up on HTML tags)
just used the sample fujiwara put up.. guess i should put credits to him too.. guess i will if anyone actually wants to use this, otherwise i'll just take it down
http://myweb.bloomu.edu/bpdowd/M&Bcode.htm

so what do you think? it can be changed however, this is just something i spent about ten minutes thinking about and putting up
probably would add various pages and organization if it picked up, put up the snippets in whatever format they are given to me or i am asked to put them in..

PS: i'll be away this weekend, youngest brother's first birthday in another state.. be back sunday, might have internet access once or twice between now and then
You should make it a wiki. Would be much better and a lot less work.
 

Janus

*spicy* *camper*
Administrator
WBWF&SM&BVC
Best answers
0
dagorkan said:
Raybur Ravenloc said:
well, i was thinking it would be nice to have a page full of code snippets with small descriptions of what they do for coders to just slap in their mod
i have something like 10Mb of space for a website, i could use that, and post up whatever code modders send to me via a post here, a PM, or an email
not an HTML master, so it won't be pretty unless someone wants to show me a better example and how to update it

heres what I slapped up in about five minutes (after brushing up on HTML tags)
just used the sample fujiwara put up.. guess i should put credits to him too.. guess i will if anyone actually wants to use this, otherwise i'll just take it down
http://myweb.bloomu.edu/bpdowd/M&Bcode.htm

so what do you think? it can be changed however, this is just something i spent about ten minutes thinking about and putting up
probably would add various pages and organization if it picked up, put up the snippets in whatever format they are given to me or i am asked to put them in..
You should make it a wiki. Would be much better and a lot less work.
Agreed, a Wiki would work best for a place to post code snippets. Why not take advantage of the Calradia.com free hosting for it?
 

Raybur Ravenloc

Regular
Best answers
0
wiki might work better, but it would be up to someone else, cause i have zero experience with wikipedia, feel free to do it, and since i have only gotten one positive response so far, i think its safe for me to take down my poor attempt..
 

Vhaeos

Veteran
Best answers
0
Janus said:
dagorkan said:
Raybur Ravenloc said:
well, i was thinking it would be nice to have a page full of code snippets with small descriptions of what they do for coders to just slap in their mod
i have something like 10Mb of space for a website, i could use that, and post up whatever code modders send to me via a post here, a PM, or an email
not an HTML master, so it won't be pretty unless someone wants to show me a better example and how to update it

heres what I slapped up in about five minutes (after brushing up on HTML tags)
just used the sample fujiwara put up.. guess i should put credits to him too.. guess i will if anyone actually wants to use this, otherwise i'll just take it down
http://myweb.bloomu.edu/bpdowd/M&Bcode.htm

so what do you think? it can be changed however, this is just something i spent about ten minutes thinking about and putting up
probably would add various pages and organization if it picked up, put up the snippets in whatever format they are given to me or i am asked to put them in..
You should make it a wiki. Would be much better and a lot less work.
Agreed, a Wiki would work best for a place to post code snippets. Why not take advantage of the Calradia.com free hosting for it?
The Mount&Blade Mod Wiki would probably be suited well enough for that. If anyone wants to try doing that, feel free. If there's something you can't do due to lack of privledges, just private message me and I'll try to get it done for you.
 

Winter

Developer
Best answers
0
Code:
  [anyone,"prisoner_chat", [], "What? You've already put me in chains, what more do you want to do?", "prisoner_chat_2",[]],
  [anyone|plyr,"prisoner_chat_2", [], "Well, as it happens, you look rather tasty . . . Let's have a bite.", "prisoner_chat_3",[]],
  [anyone|plyr,"prisoner_chat_2", [], "Nothing.", "close_window",[]],
  [anyone,"prisoner_chat_3", [], "No! Nooooooooo!", "prisoner_chat_4",
	[
	 (store_conversation_troop,reg(3)),
	 (remove_troops_from_prisoners,reg(3),1),
	 (try_begin),
	 (store_free_inventory_capacity,reg(4),"trp_player"),
	 (ge,reg(4),1),
	 (troop_add_item,"trp_player","itm_dried_meat"),
	 (end_try),
	]],
  [anyone|plyr,"prisoner_chat_4", [], "There. Someone bring me my boning knife!", "close_window",[]],
Because the people in the Suggestions forum kept asking for it. Anyone who wants it, feel free.

Wastefully,
Winter