As title states. I'm working on a mod to give Human Nobles a key that will allow them to unlock doors if they don't have the proper lockpicking skill. I'm not very experienced with scripting in the toolset, so I'm hoping to benefit from example scripts any of you forum members here could provide.
I can give players items, and I've figured out how to modify the doors, so I just need a method to detecting a character background. It would be a little awkward to give a mage, or a Dalish a key that does nothing. :B
Detecting Character Origin
Débuté par
electricfish
, mars 02 2011 04:16
#1
Posté 02 mars 2011 - 04:16
#2
Posté 02 mars 2011 - 04:52
I *think* there's a defined flag you can check in one of the generic plots; you can certainly check class, race, gender etc that way so I assume origins would be in there too. That would work well for your situation because you're only interested in the one origin.
It's possible to set the background with a chargen function, I'm not sure if there's a corresponding Get function, but there may well be.
Finally, you could just try to put your key into the Human Noble origin gameplay (eg the Cousland castle area), since you can expect that only Human Nobles will go there.
It's possible to set the background with a chargen function, I'm not sure if there's a corresponding Get function, but there may well be.
Finally, you could just try to put your key into the Human Noble origin gameplay (eg the Cousland castle area), since you can expect that only Human Nobles will go there.
#3
Posté 02 mars 2011 - 04:57
The chargen scripts set a flag in one of the generic plots, so scripting-only method is possible. There is also the option of creating a containter and using PRCSCR to place it in the area.
Personally, I'd just use a PRCSCR that only works in the Cousland Castle (if this is for DAO itself) to give the key once (using a plot flag to check.)
Personally, I'd just use a PRCSCR that only works in the Cousland Castle (if this is for DAO itself) to give the key once (using a plot flag to check.)
#4
Posté 02 mars 2011 - 11:35
Mengtzu: Not sure what you mean by putting it int he castle directly? Wouldn't I have to compile that entire area and put it in a dazip for it to work? That doesn't seem like it would be very compatible with other Human Noble origin mods.
jackkel: Now that you mention it, just sticking this key inside a spawned chest might be an easier way to go. Can you (or someone else) explain what a PRCSCR does, and how it would target the Castle? Is it like a special scripting template that's different from some of the other item giving tutorials?
jackkel: Now that you mention it, just sticking this key inside a spawned chest might be an easier way to go. Can you (or someone else) explain what a PRCSCR does, and how it would target the Castle? Is it like a special scripting template that's different from some of the other item giving tutorials?
#5
Posté 02 mars 2011 - 11:55
Okay. I found a thing on the Social toolset wiki that I think would do the trick, with some tweaking.
In the script template it's used it, it's a prerequisite to creating a waypoint (or something) in Origins. I've seen a similar thing in the item giving script I use for my current project, so it's a good bet that I could use this before the "give item" line to make sure that players are only given the object within the castle. Right?
If Lothering is considered an object in this fashion, could I use this same format with the daytime Cousland Castle? Is it considered a oTown, or would I have to change it to something different?
object oTown = GetObjectByTag("lot100ar_lothering");
In the script template it's used it, it's a prerequisite to creating a waypoint (or something) in Origins. I've seen a similar thing in the item giving script I use for my current project, so it's a good bet that I could use this before the "give item" line to make sure that players are only given the object within the castle. Right?
If Lothering is considered an object in this fashion, could I use this same format with the daytime Cousland Castle? Is it considered a oTown, or would I have to change it to something different?
Modifié par Zorr Crew, 02 mars 2011 - 11:57 .
#6
Posté 02 mars 2011 - 07:59
http://social.biowar...ndex.php/PRCSCR
This page and the links to the M2DA and script templates (esp. for adding an item to inventory) should help. The 2da uses the area list for Cousland castle (I'll look it up in a moment) and your custom script.
*edit*
The area list name for Castle Cousland (Day) is "bhn01al_castle_cousland."
You may also want to use a custom plot resource and set conditions in your script so it runs only once (otherwise you'd get a key every reload.)
If you still want to know how to check origins, it's in the plot resource "gen00pt_backgrounds."
I hope that helps.
This page and the links to the M2DA and script templates (esp. for adding an item to inventory) should help. The 2da uses the area list for Cousland castle (I'll look it up in a moment) and your custom script.
*edit*
The area list name for Castle Cousland (Day) is "bhn01al_castle_cousland."
You may also want to use a custom plot resource and set conditions in your script so it runs only once (otherwise you'd get a key every reload.)
If you still want to know how to check origins, it's in the plot resource "gen00pt_backgrounds."
I hope that helps.
Modifié par jackkel dragon, 02 mars 2011 - 08:20 .
#7
Posté 08 mars 2011 - 03:56
This is epic late, but the PRCSCR pages helped a lot. I was expecting to do this massive thing since there doesn't seem to be any explicit "if PC_Origin=" type function in the scripts.
Seems to be functioning okay, and now it's off to fiddle some more with doors and removing the key once the PC reaches the night time siege.
Thank you for your help. I definitely appreciate it.
Seems to be functioning okay, and now it's off to fiddle some more with doors and removing the key once the PC reaches the night time siege.
Thank you for your help. I definitely appreciate it.





Retour en haut







