If anyone can help me with these questions, I would greatly appreciate it.
1) How do you return the name of an item using the object in the scripts... not the resource name but the actual name? Am I using c++ pointers to dereference in the scripts?
i.e.
object oItem = getItem();
string name = oItem->Name;
2) Where is the complete listing of Events? I see Scripts.ldf listed as the source but how can I peek into this file?
3) How do I mod the original scripts within my module?
i.e. I change something in sys_rewards.h and I would like my module to override that.
4) How do I find the definitions of functions? i.e. GetEventInteger(ev, 0);
I have more questions but I'll keep digging.
Thanks
Events and scripting questions
Débuté par
Lieutenant08
, nov. 10 2009 05:31
#1
Posté 10 novembre 2009 - 05:31
#2
Posté 10 novembre 2009 - 06:01
1. Try GetName(oItem)
2. It's in packages\\core\\data\\scripts.erf. You can extract it using the toolset.
3. Good question. You can modify them by checking them out, but there's only 1 version of the resource that's shared by every module in your database, so make sure you take that into account.
4. Doc comments are in scripts.ldf. You can also right click the identifier and go to definition. More information on some functions is on the wiki, but it's currently spotty.
2. It's in packages\\core\\data\\scripts.erf. You can extract it using the toolset.
3. Good question. You can modify them by checking them out, but there's only 1 version of the resource that's shared by every module in your database, so make sure you take that into account.
4. Doc comments are in scripts.ldf. You can also right click the identifier and go to definition. More information on some functions is on the wiki, but it's currently spotty.
#3
Posté 10 novembre 2009 - 06:23
Thank you for the quick reply.
1) Will try that... makes since doh!
2) Extracted it using the toolset, then opened it with wordpad. Outstanding!
3) I'm still not sure how how this works.
Do changes need to override the entire script? or does my script get execute after the default scripts? Like using an Observer pattern, where I subscript to events.
4) Reading through the script.ldf now.
Thank you again. Outstanding... wish this information was nicely packed into the wiki.
1) Will try that... makes since doh!
2) Extracted it using the toolset, then opened it with wordpad. Outstanding!
3) I'm still not sure how how this works.
Do changes need to override the entire script? or does my script get execute after the default scripts? Like using an Observer pattern, where I subscript to events.
4) Reading through the script.ldf now.
Thank you again. Outstanding... wish this information was nicely packed into the wiki.
#4
Posté 10 novembre 2009 - 06:35
With respect to modifying something like sys_rewards_h ... yeah, you'd have to override the whole file. Hopefully you are not trying to get those changes into the single player campaign - the script compiler doesn't compile those functions separately from the scripts they're included in, so you'd have to recompile all the scripts in the game, which is kind of tricky without any source code =)
However, there are some other cases where a chain of event handlers is used (via the HandleEvent function). In those cases, sometimes you can insert yourself into the call chain before the system scripts and override behavior that way... like using a script other than area_core for your areas, etc.
However, there are some other cases where a chain of event handlers is used (via the HandleEvent function). In those cases, sometimes you can insert yourself into the call chain before the system scripts and override behavior that way... like using a script other than area_core for your areas, etc.
#5
Posté 10 novembre 2009 - 06:55
Hmm... I'm interested in intercepting the call chain and handling the events in my own scripts. Do you have any examples of how to do this?
What I'm looking at right now is removing the DropStealth(stEvent.oCaster); in the skill_stealing->HandlerImpact() script.
It almost seems that there is no way around cut&pasting the default code to my module then making changes.
Hmm... I should try this.
You sir, are most helpful.
What I'm looking at right now is removing the DropStealth(stEvent.oCaster); in the skill_stealing->HandlerImpact() script.
It almost seems that there is no way around cut&pasting the default code to my module then making changes.
Hmm... I should try this.
You sir, are most helpful.
#6
Posté 10 novembre 2009 - 07:02
The scripts for abilities are set in the ABI_base 2da file. You can override entries in the table to change the spellscript to something else, but I haven't done it. Check out this wiki page for information on 2DAs and M2DAs.





Retour en haut






