Aller au contenu

Photo

Add a custom skill to the craft GUI


  • Veuillez vous connecter pour répondre
11 réponses à ce sujet

#1
Phaenan

Phaenan
  • Members
  • 315 messages
Does anyone know if that's possible and how ?
I'm working on a new craft skill, and while I can pretty much make the system correctly deal with the recipes, skill tiers and such (that's the easy part) I can't for the sake of me get the GUI windows to indulge my fancies.
Here is the script dealing with that at the moment. If tried with and without properly setting the ProcessWithEvent in the ability/skill 2DA entry, without any luch.
- phae_forge_enchantskl.nss pastie

When I try to set everything right, recipes linked with the new skill etc, and then invoke the craft GUI, I end up on an empty frame : (note no OC skill is "selected" here)
Posted Image
The recipes themselves are not the issue, they are working fine and appear under other skills when I change their skill ID in order to test : (don't mind the "null" label, just didn't change the GDA  for that strref yet)
Posted Image

Is there something I should manually do after ShowCraftingGUI() to fill my craft skill recipes page ? Or something else I'm missing ? :mellow:

Modifié par Phaenan, 26 novembre 2009 - 08:22 .


#2
AND04

AND04
  • Members
  • 154 messages
hmm, didn't try that yet (just the normal recipies to an existing category) - but i can give it a try later tonight

#3
Phaenan

Phaenan
  • Members
  • 315 messages
That's not vital since I can always copy the nwn2 crafting system (everything in a box, a script, shaza~am) but getting the Dragon Age native craft UI to work  would be some much prettier. ^_^

#4
indio

indio
  • Members
  • 204 messages
Any success in this area would be of great interest to many, I suspect. Certainly to me.

#5
Phaenan

Phaenan
  • Members
  • 315 messages
Aye, but with the core unavailable and script.ldf containing only headers, we're basically blindfolded... :?

#6
FollowTheGourd

FollowTheGourd
  • Members
  • 572 messages
I don't know how much of this will help you, but here's the main ActionScript (Flash script, not DAScript) behind the crafting GUI: pastie.org/716750. That's "machine decoded" and probably needs cleaning up here and there, but it should give you the gist of it.

I'm not remotely familiar with how crafting works internally, but looking at if briefly, there's a LoadRecipes() function that makes a call to a BaseCraftingSkillOf() function which has hardcoded skill levels which correspond to a skill (herbalism, poisons, and traps). So that would be my guess as to why your skill isn't working in the GUI... for starters.

It should be possible to change that, but like changing anything in the GUI... it's a huge pain currently, at least depending on what you're trying to do and how much is hidden in the engine. But with any luck, this should be expandable.

Anyway, I might have misunderstood your intent somewhere in your first post, since I'm not 100% sure what you said is working and what isn't in the GUI. My understanding is you wanted a 4th skill (e.g., herbalism, posions, traps, basket weaving) and when you open the crafting GUI with the 4th skill as an argument, no recipes show up in the GUI.

Modifié par FollowTheGourd, 27 novembre 2009 - 03:08 .


#7
Phaenan

Phaenan
  • Members
  • 315 messages
Yes, that's what I'm trying to do.

I just glanced through it right now and well, the skills value are indeed hardcoded in there... Bit of a shame. I'll see if I can do something.



Cheers for the input, I'll have a good look at it this evening. :o

#8
Phaenan

Phaenan
  • Members
  • 315 messages
Well, I just took some time to read your explanations on the GUI Editing thread, but I feel that's a bit out of my league. I wouldn't really know where to start to repack crafting.gfx with a modified ActionScript. So I'll probably leave it to some other modder to pave the way. :/

#9
FollowTheGourd

FollowTheGourd
  • Members
  • 572 messages
Well, if you gave me the numerical values for your skill constants, I could try adding them to the script and see if the naive approach works (I wouldn't really know until you told me whether or not it worked, until I get up to speed on DAScript and crafting). Even if it doesn't, I wouldn't give up right away - I'd find it interesting myself to get it working.

I haven't really written anything better detailed on editing the UI yet, but if you're interested I could try to walk you through what I've pieced together so far. I have an idea how I might be able to eventually get to edit proper ActionScript, but in the meantime, unless you're comfortable using *very simple* assembly language, then editing pre-existing GUI scripts might be a bit onerous. It's just right now there are some script properties that aren't standard... maybe they're so-called intrinsics, or maybe they're prototypes (but defined where?) - I'm just not sure, but I think I should be able to get their values (or set up the proper interfaces) and eventually be able to compile normal ActionScript instead of editing the p-code.

And my last post in that thread you referenced... you don't *really* have to follow any of that to edit the UI for the most part, but it has come in handy in figuring some stuff out.

To be honest, this was sort of out of my league too when I first started. I guess a lot of determination and a small dash of madness prodded me forward.

Modifié par FollowTheGourd, 28 novembre 2009 - 01:00 .


#10
Phaenan

Phaenan
  • Members
  • 315 messages
I wasn't trying to make you give a hand (and was already grateful for the pointers) but I can't see myself refusing the help here. 
What I can't get my head around is basically the gfx repacking once the script is modifed. I probably lack basic Flash knowledge here, as I never took some time to play with it.

Actually, I also had a try at Flare & Sothink but the GFx don't play nice and aren't directly decompiled. So I grabbed my tools, replaced the magic number I'd never have figured out myself, and shazaam. Could get the SWFc code. Lookie, she's using words she learned just 5 mins ago. ^_^

And that's pretty much the end of what I can figure out.
Do I simply have to change the AS in order to make a fourth skillset work, then clean it until it's willing to recompile ? Well, I shall try while I am at it. Gonna hate the alarm tomorrow morning tho.
So let's take the Sothink extracted resources since they are much cleaner and let's have a look at that Crafting.as in my Flash. Never did AS but the syntax doesn't look that unfamiliar...

* tinkers a while *

Well, I could repack (recompile ?) the movie into a new crafting_twf.swf using a modified AS. Here is the new script : pastie
Basically I just added conditions and declarations for my skillset IDs : 568000 (main skill) and 568001, 568002 and 568003. (t2-t4 upgrades)

I suppose I now have to redo that magic number trick.
Hm. Tchak. Done. Got a brand new crafting.gfx and injected into my guiexport.erf. Hm ? Of course I did a backup, I know it'll crash. ^_^


* load the game, tries to open the craft window *

Huhu. Nice run but quite not there yet Phae dear :

Posted Image


Somebody interested in a blank book GUI mod ? :whistle:

Modifié par Phaenan, 28 novembre 2009 - 01:59 .


#11
FollowTheGourd

FollowTheGourd
  • Members
  • 572 messages
It's no skin off my back to try to help. I might as well try to contribute something for all I've learned reading other people's posts.

For some reason my ISP's DNS server is pretty messed up right now (gotta look into OpenDNS, or whatever it is), so I can't access imageshack right now - but when you get a blank GUI, in my experience so far, it usually means that something in the SWF/GFX file itself got messed up, and not so much anything to do with your script. Edit: imageshack finally resolved, and I see what you're seeing - just the "book" background. That's actually a separate GFX file (bookback.gfx IIRC), so even if you mess up the GUI file you're editing, you'll still see the book - unless you explicitly edit that GFX file and mess it up too. =]

ActionScript is basically just JavaScript (maybe not exactly for all I know, but I'm not a language lawyer). The main thing to learn beyond that is a little of how Flash works, which I can't really sum up in one post.

I'm a bit tired right now, so I hope the following makes some sense. If it doesn't, please let me know and I'll try to clarify some things after I've had a bit more sleep. :)  I haven't really had a chance to examine your modified file, but I'll do that soon.

Unless you have a registed version of sothink (and not just the demo version), it won't decompile all the scripts, so that's one reason why I recommended Flare, even though what it outputs is less clear. But the main thing is that I've only been using the actual *.as files as a quick way of understanding where I need to edit currently.

The problem with ActionScript is getting it back into the GUI. You could always decompile the SWF back into a FLA, but then Dragon Age's ActionScript isn't "standard enough" to recompile using Adobe Flash Professional (there's a 30 day trial version) or MTASC (an opensource compiler). I'm hoping to get that to work, but so far I've been using "flasm" to edit the p-code instead - which is basically like assembly language, but at least it isn't going to refuse to compile unless I make a syntax error or try to change too much of the SWF file structure (like add events that weren't there originally, but you can get around that with ActionScript nowadays). That can be a bit overwhelming at first, but if you compare the output from flasm against the ActionScript from flare or sothink, then it's a lot easier going.

Between the SWF file formats at m2osw.com, adobe's site (don't know the exact URL off-hand), and other sites like "the-labs.com" and "half-serious.com" I've been able to figure a lot out, but if you just want to edit the scripts, then the m2osw.com site has a pretty good reference on the commands you can use at the p-code level.

Modifié par FollowTheGourd, 28 novembre 2009 - 03:23 .


#12
Phaenan

Phaenan
  • Members
  • 315 messages
Next time I'll have look at the p-code then. Cheers for the explanations. :o