Author Topic: PYTHON SCRIPT/SCHEME EXCHANGE  (Read 286623 times)

0 Members and 1 Guest are viewing this topic.

jik

  • Knight
  • *
    • View Profile
  • Faction: Neutral
Re: PYTHON SCRIPT/SCHEME EXCHANGE
« Reply #375 on: March 10, 2009, 08:32:35 PM »
Inconsistances in the code?  The hell you say :lol:

quite a few.  They get to you after a while...  then you go numb...

MartinF

  • Squire
  • *
  • Down Under
    • View Profile
  • Faction: Neutral
Re: PYTHON SCRIPT/SCHEME EXCHANGE
« Reply #376 on: March 11, 2009, 09:10:43 AM »
speaking of inconsistencies, I just saw that you can call this from the operations of a dialog tuple: [encounter_attack]

so that makes it ,[[encounter_attack]]],

Pff.. why the hell isn't it just (encounter_attack)


killkhergit

  • Squire
  • *
    • View Profile
  • Faction: Bandit
  • MP nick: Asbak
Re: PYTHON SCRIPT/SCHEME EXCHANGE
« Reply #377 on: March 11, 2009, 09:24:02 AM »
It's the module_dialoge syntax. As easy as that:

[[stuff to execute]]]

Open the consequences list, opens a tuple, closes tuple, closes consequences, closes dialoge. Simple. :mrgreen:


MartinF

  • Squire
  • *
  • Down Under
    • View Profile
  • Faction: Neutral
Re: PYTHON SCRIPT/SCHEME EXCHANGE
« Reply #378 on: March 11, 2009, 10:34:31 AM »
yeah and of course it makes perfect sense that it works that way in the dialogs.py but in game_menus it's (change_screen_trade_prisoners), just to name one. Which is the way it's listed in header operations. But if you want to use that in dialog, it has to be [change_screen_trade_prisoners]

I agree.. much more logical system, that :)

Also, what you're saying is not really true because using say [change_screen_trade_prisoners] doesn't really close the dialog, you still come back to the dialog afterwards. Either way, you can defend it all you want but it's still a stupid way of doing it and there's really no reason I can see to deviate from the normal syntax that you use in all your other files.
« Last Edit: March 11, 2009, 10:36:39 AM by MartinF »

Mordachai

  • Squire
  • *
    • View Profile
  • Faction: Neutral
Re: PYTHON SCRIPT/SCHEME EXCHANGE
« Reply #379 on: March 11, 2009, 02:50:37 PM »
Martin - I don't think Killkhergit was defending the syntax or saying what side-effect it has - just stating what the brackets started and ended -  what they match up against.

I've noticed that you can get away with leaving out the inner () of a [] if you have only one statement.  Equally, it seems you can have a redundant layer of [] or ().  At least, that seems to be the case so far.

Similarly, the last () in a series doesn't need to have a , after it, but most do.

[(something),(else)]      -or-     [(something),(else),]

and even:

[something] -or- [(something)] -or- [(something),]  -and-maybe- [[something]]

Are all equally valid in an execution block.  I don't know Python really - just enough to modify the existing module system code - so I don't know where these artifacts come from - but I assume its a derivative of the underlying language requirements  - which appear to be fairly flexible.

Also, I updated my code to go back to using the quoted ("skl_persuasion") symbol so that no extra imports were required, and reduce the number of differences that show up when I do a diff with the original code (to double check what I've really modded).  They're inconsistent, but its too much effort in the end to try to improve all of their code... especially when it just muddies the issue in the end.

Cheers

EDIT: D'oh!  Sorry to muddy this thread.  Won't happen again :P
« Last Edit: March 11, 2009, 03:07:36 PM by Mordachai »

Red River

  • Sergeant Knight
  • *
    • View Profile
  • Faction: Neutral
Re: PYTHON SCRIPT/SCHEME EXCHANGE
« Reply #380 on: March 11, 2009, 03:02:13 PM »
please post your workin' code with details here only.. this is a no discussion thread so keep it clean pls! for all other stuff create a separate topic :)

tavener

  • Regular
  • *
    • View Profile
  • Faction: Vaegir
Re: PYTHON SCRIPT/SCHEME EXCHANGE
« Reply #381 on: March 13, 2009, 11:45:19 PM »
where is the PYTHON for v.9011??

Amman de Stazia

  • Master Knight
  • *
  • schizophrenic? There's three of us now!
    • View Profile
  • Faction: Neutral
Re: PYTHON SCRIPT/SCHEME EXCHANGE
« Reply #382 on: March 15, 2009, 02:23:13 AM »
check module system documentation.
But let me recommend 1.0 to you.  Better.
http://forums.taleworlds.net/index.php/topic,12250.msg208344.html#msg208344

Family IS more important than Mount and Blade. 

Family D'Stazia.  (A, K and S )

PS - this line plugs TPW - The Peninsular War mod.http://forums.taleworlds.net/index.php/topic,42454.0.html

kt0

  • Knight
  • *
    • View Profile
  • Faction: Swadian
kt0's guide to overpowered items
« Reply #383 on: March 30, 2009, 02:53:15 AM »
A long (long) time ago I played an awesome RPG named Earthdawn.  One of the fun features it has is equipment that grows in power as your characters do.  So why can't we have that in M&B?

NOW YOU CAN!

This stuff is free to use for anyone who can figure out how to make it work, just give credit when releasing to other people.

How it works:
(click to show/hide)

The code is pretty straightforward.  It's entirely possible that I've forgotten some part of it.  Let me know when you find those.  Also, I've tested this a bit but not tremendously so when you find bugs, let me know about those too.  Finally, I didn't fill everything out for all skills; I'm lazy.  It should be pretty clear what needs to be added and I've left some comments as well.

Stuff in module_constants.py which I stuck after the other item slot stuff:
(click to show/hide)

New scripts in module_scripts.py (I stuck mine at the bottom):
(click to show/hide)

Stuff that gets spliced into existing code in module_scripts.py:
(click to show/hide)

Stuff that you can stick wherever you like to make the items gain levels:
(click to show/hide)

The test data I used (slightly mangled):
(click to show/hide)

Enjoy!

edit:  Hey look!  A picture! 
(click to show/hide)
« Last Edit: March 30, 2009, 03:03:49 AM by kt0 »

MrRoy

  • Language Moderator
  • *
    • View Profile
  • Faction: Swadian
  • M&B
Re: PYTHON SCRIPT/SCHEME EXCHANGE
« Reply #384 on: March 30, 2009, 03:06:30 AM »
kt0 that sounds like an epic script, but im not sure what it does, if im right, as your character level up (and stats increase) your equipment does too? Like lets say your level 10, your gear will have X armor, then at lvl 20 it will have X+20 ? Or am I wrong, what do you mean exactly?

kt0

  • Knight
  • *
    • View Profile
  • Faction: Swadian
Re: PYTHON SCRIPT/SCHEME EXCHANGE
« Reply #385 on: March 30, 2009, 03:20:06 AM »
kt0 that sounds like an epic script, but im not sure what it does, if im right, as your character level up (and stats increase) your equipment does too? Like lets say your level 10, your gear will have X armor, then at lvl 20 it will have X+20 ? Or am I wrong, what do you mean exactly?
That's the basic idea.  I left it open as to where you stick the levelling part.  Player EXP is the obvious place, but renown gain, honor gain, time based trigger, etc. are also possibilities.  I currently have mine hooked up to renown hence the smallish values for needed xp.  I also have it hooked up to a mod menu for testing.

If you trace through the Sword of Ultimate Overkill's levels (under test data spoiler) you can see that it gains speed and damage as it levels.  You can pretty much work with any item this way.  You can even change how they look between levels since it swaps out the item ID.  I haven't figured out how to change attributes or proficiencies if you can even do that. 

MartinF

  • Squire
  • *
  • Down Under
    • View Profile
  • Faction: Neutral
Re: PYTHON SCRIPT/SCHEME EXCHANGE
« Reply #386 on: March 30, 2009, 04:31:34 AM »
adding skill bonuses is easy enough, you just need to alter the script that handles these bonuses so it checks for a slot on the item and then adds a bonus. I use that for the starships in SWC, they give several skill bonuses.

attribute bonus doesn't exist. Of course it's easy enough to fake this with some sort of trigger. When the item gets equiped, raise str by 1, when it's no longer equiped, lower str by 1 (for instance). Problem is that this won't change the attribute color, so the player won't know he has a bonus. But you might be able to change the colors somewhere as well, the fact that it's done on the fly for skills means it's probably somewhere in the code, doesn't seem like something you'd hardcode.

Nice idea btw! Have some truly epic weapons and make them level up to become more powerful.

PaperJack

  • Recruit
  • *
    • View Profile
  • Faction: Rhodok
Re: PYTHON SCRIPT/SCHEME EXCHANGE
« Reply #387 on: April 03, 2009, 10:34:20 PM »
I'm pretty much a newbie in M&B modding, and I've been wondering how can I make a crossbow shoot a unique projectile instead of the default bolt. Can somebody please enlighten me ?

Lord Leoric of Wercheg

  • Grandmaster Knight
  • *
  • Self-interest above all else.
    • View Profile
  • Faction: Neutral
Re: PYTHON SCRIPT/SCHEME EXCHANGE
« Reply #388 on: April 04, 2009, 02:50:11 AM »
Ummmm, does anyone have the code for spear wall? I've searched and the only results I get are mention of it in mod features, credits, but no code. :(
You willingly live in Japan, your opinion is invaid.

You can't spell, your opinion also is invalid.
Don't like it? ****. Like it? ****. So-so? Harder!

kt0

  • Knight
  • *
    • View Profile
  • Faction: Swadian
Re: PYTHON SCRIPT/SCHEME EXCHANGE
« Reply #389 on: April 04, 2009, 05:05:54 AM »
Tagging my post with autoresolve hackery here so it doesn't get lost:  http://forums.taleworlds.com/index.php/topic,59553.msg1575769.html#msg1575769.  There's a lengthy discussion that goes along with it.  Here's where I started my fateful journey into the guts of game_event_simulate_battle:  http://forums.taleworlds.com/index.php/topic,58962.0.html

Enjoy!