Putting the 'role' back in role-playing games since 2002.
Donate to Codex
Good Old Games
  • Welcome to rpgcodex.net, a site dedicated to discussing computer based role-playing games in a free and open fashion. We're less strict than other forums, but please refer to the rules.

    "This message is awaiting moderator approval": All new users must pass through our moderation queue before they will be able to post normally. Until your account has "passed" your posts will only be visible to yourself (and moderators) until they are approved. Give us a week to get around to approving / deleting / ignoring your mundane opinion on crap before hassling us about it. Once you have passed the moderation period (think of it as a test), you will be able to post normally, just like all the other retards.

Temple+ Modding Discussion

Zaxis

Barely Literate
Joined
May 6, 2017
Messages
4
Yeah sure. The link is here: https://gist.github.com/Onyx2/3ffe00d839b7949fcfdf2ba53f1185e0

You may recognise the profile. I was the one who was creating that bladesinger PRC for ToEE a while ago and never finished it (got distracted with other stuff). That's another project I'm also working on, but I'd like to get this more simple mod done first.
 

Sitra Achara

Arcane
Joined
Sep 1, 2003
Messages
1,860
Codex 2012 Codex 2013 Codex 2014 PC RPG Website of the Year, 2015
Yeah sure. The link is here: https://gist.github.com/Onyx2/3ffe00d839b7949fcfdf2ba53f1185e0

You may recognise the profile. I was the one who was creating that bladesinger PRC for ToEE a while ago and never finished it (got distracted with other stuff). That's another project I'm also working on, but I'd like to get this more simple mod done first.

Hi! Welcome back.

The problem was with the char_class file, it was missing this:
Code:
def IsEnabled():
    return 1
 

Zaxis

Barely Literate
Joined
May 6, 2017
Messages
4
Can't believe I missed that! Anyway I've basically finished the battle sorcerer. I have two remaining problems though.

1: I need to reserve one of the class enums for the battle sorcerer. It only levels up correctly when I change its name to "warlock" or one of the other reserved classes. This is an issue I also had when making the bladesinger months ago so I'm pretty certain that's the problem. I don't mind which number is reserved, I'll just change the files accordingly.

2: I can't get the battle sorcerer's bonus feat to appear at 1st level (like the fighter and the eldritch knight). It only appears at 2nd level. I'll update the gist page with the newer files.
 

Sitra Achara

Arcane
Joined
Sep 1, 2003
Messages
1,860
Codex 2012 Codex 2013 Codex 2014 PC RPG Website of the Year, 2015
Can't believe I missed that! Anyway I've basically finished the battle sorcerer. I have two remaining problems though.

1: I need to reserve one of the class enums for the battle sorcerer. It only levels up correctly when I change its name to "warlock" or one of the other reserved classes. This is an issue I also had when making the bladesinger months ago so I'm pretty certain that's the problem. I don't mind which number is reserved, I'll just change the files accordingly.

46 is fine. If you want I can add it to the Temple+ "official" roster ;)

2: I can't get the battle sorcerer's bonus feat to appear at 1st level (like the fighter and the eldritch knight). It only appears at 2nd level. I'll update the gist page with the newer files.
Yeah looks like I didn't hook the character creation feat selection UI. Will have to do that (shouldn't take long since it's pretty much copy+paste from the levelup UI).
 

qed

Novice
Joined
May 13, 2017
Messages
5
Does anybody know where I can find scripts for all ingame feats? Especially 'Improved Critical' one. I'll be glad for anything crit-related, cause I'm trying to add some Ranger spell that makes next hit auto-crit if shot hits the target. I searched for hours in differect .dat files but found nothing even remotely close.
 

Sitra Achara

Arcane
Joined
Sep 1, 2003
Messages
1,860
Codex 2012 Codex 2013 Codex 2014 PC RPG Website of the Year, 2015
The vanilla feat effects are all hardcoded unfortunately.

Here's what Improved Critical looks like under the hood:

Code:
int __cdecl ImprovedCriticalGetCritThreatRange(DCA args)
{
  // [COLLAPSED LOCAL DECLARATIONS. PRESS KEYPAD CTRL-"+" TO EXPAND]

  threatRangeSize = 1;
  featEnum = CondNodeGetArg(args.subDispNode->condNode, 0);
  impCriticalWeapType = CondNodeGetArg(args.subDispNode->condNode, 1);
  evtObj = DispIoCheckIoType05(args.dispIO);
  weapUsed.handle = GetWeaponUsed(&evtObj->attackPacket).handle;
  if ( weapUsed.handle )
  {
    weapType = GetInt32(weapUsed, obj_f_weapon_type);
    threatRangeSize = GetInt32(weapUsed, obj_f_weapon_crit_range);
  }
  else
  {
    weapType = 1;                               // unarmed strike I think
  }
  if ( weapType == impCriticalWeapType )
  {
    v7 = (char *)GetFeatName((feat_enums)featEnum);
    bonusAddToBonusListWithDescr(&evtObj->bonlist, threatRangeSize, 0, 114, v7);
  }
  return 0;
}

Basically you need to add a ET_OnGetCriticalHitRange hook, and inside that one add a bonus to the .bonus_list property.
BTW looking at the code I'm pretty sure it'll stack with the Keen enhancement, contrary to what the feat description (and tooltip) says. Heh.
 

qed

Novice
Joined
May 13, 2017
Messages
5
Thank you very much for your reply. That helps a lot.

Do I need to create a new modifier or I can add hook inside spell script file? And where can I look at bonus_type constants from .add(value, bonus_type, text) method?
 

Zaxis

Barely Literate
Joined
May 6, 2017
Messages
4
I assume that means that hardcoding extends to the quicken spell feat? The Complete Warrior bladesinger's "Song of Celerity" class feature makes use of a quicken spell type effect (but without any adjustment to the spell's casting time or level). If that's not possible, I could try to do the Races of Faerun version instead, but that involves a similarily complex ability (casting a spell as part of a full-attack action). Alternatively I could just give the bladesinger quicken spell as a bonus feat at level 5 instead, but considering its not a particularly powerful PRC, I'd like to avoid that if possible.
 

cowking

Scholar
Joined
Oct 18, 2016
Messages
115
Thank you very much for your reply. That helps a lot.

Do I need to create a new modifier or I can add hook inside spell script file? And where can I look at bonus_type constants from .add(value, bonus_type, text) method?

Bonus types
are listed in the dll wiki.

You would create a spell script that adds a new spell condition to the ranger where you hook to ET_OnGetCriticalHitRange giving you a +20 bonus to your crit range, using bonus type (0) I assume.

You could hook the condition removal to ET_OnDealingDamage2 (but this probably doesn't trigger if you don't hit in case you want it that way). Another alternate would be ET_OnD20ActionPerform using event key EK_D20A_UNSPECIFIED_ATTACK (or perhaps multiple hooks for different attack types), although not all actions trigger for ET_OnD20ActionX stuff, see Q5 here. It's very likely you're just gonna have to test some stuff out depending on how you wanna go about it.
 
Last edited:

Sitra Achara

Arcane
Joined
Sep 1, 2003
Messages
1,860
Codex 2012 Codex 2013 Codex 2014 PC RPG Website of the Year, 2015
IIRC the assassin's Death Attack has a good example of getting a trigger on a to-hit roll.

I assume that means that hardcoding extends to the quicken spell feat? The Complete Warrior bladesinger's "Song of Celerity" class feature makes use of a quicken spell type effect (but without any adjustment to the spell's casting time or level). If that's not possible, I could try to do the Races of Faerun version instead, but that involves a similarily complex ability (casting a spell as part of a full-attack action). Alternatively I could just give the bladesinger quicken spell as a bonus feat at level 5 instead, but considering its not a particularly powerful PRC, I'd like to avoid that if possible.
You can modify an action's casting time now, check out rapid metagic feat.
 

Sitra Achara

Arcane
Joined
Sep 1, 2003
Messages
1,860
Codex 2012 Codex 2013 Codex 2014 PC RPG Website of the Year, 2015
2: I can't get the battle sorcerer's bonus feat to appear at 1st level (like the fighter and the eldritch knight). It only appears at 2nd level. I'll update the gist page with the newer files.

Yeah looks like I didn't hook the character creation feat selection UI. Will have to do that (shouldn't take long since it's pretty much copy+paste from the levelup UI).

Ok PC Creation Feat UI has been recreated for next version, you can test it out using the latest dev build (you can extract to some random folder and run templeplus.exe from there):
https://ci.appveyor.com/project/shartte/templeplus/build/artifacts
 

CarlosC77

Barely Literate
Joined
Aug 10, 2017
Messages
1
Sorry to bother,

Let me begin with... my modding and programming experience is virtually nil. With that said, I've been trying to fix the random_encounter.py script in the \\data\scr folder to incorporate the check for the spyglass item into the PC_Modifer() function but can't get it to work in Temple+.

When I load a game using the Co8 front-end it works ok and doubles the PC_modifier result but not when I start the game with Temple+. I'm guessing the script has been incorporated into Temple+ but I dare not tear into it for such a minor change.

Is there any way to fix this for a future release. It should be a quick fix as the code is already there a few lines down in the def group_skill_level( pc, skill ) function which is not referenced anywhere else in random_encounter.py

Thanks,
 

Sitra Achara

Arcane
Joined
Sep 1, 2003
Messages
1,860
Codex 2012 Codex 2013 Codex 2014 PC RPG Website of the Year, 2015
Yeah I applied an override to it inside tpgamefiles.dat. you can extract it, modify, and repack it or put it in rhe user overrides folder (see TP wiki for more info).
 

DnDPaladin

Novice
Joined
May 9, 2016
Messages
30
Maybe its me missing something here...
i have the latest Co8 which is the new content 8. whatever !
i also am playing temple+ because i fucking love the new content it has.

but everytime i try to flee combat because of some combat go awry... it just says invalid action an dmy party gets wiped out.
i am near the entrance of the broken tower, i entered it by mistake my party is really not high level enough for it. and now i am stuck in combat with those guys and getting my party of 3 getting slaughtered.
and since i only use auto saves... im stuck on that one !

so how the fuck does Flee combat radial menu does ? if not actually fleeing the combat ?
 

btbgfel

Scholar
Joined
Nov 10, 2014
Messages
111
Newbie needs help here.
I made a test python modifier below
from templeplus.pymod import PythonModifier
from toee import *
from __main__ import game
from utilities import *
import tpdp

print "Registering TestA"

def OnNewRoundBegin(attachee, args, evt_obj):
print "Num ticked: " + str(evt_obj.data1)
game.party[0].stat_base_set(stat_strength,66)
return 0

InfS = PythonModifier("ToTestA", 0)
InfS.AddHook(ET_OnBeginRound, EK_NONE, OnNewRoundBegin, ())

The "Registering TestA" part was printed in console.
"Num ticked"+No. didn't and 1st party member strength wasn't set to 66 either.
I don't know what's faulty.
 
Last edited:

btbgfel

Scholar
Joined
Nov 10, 2014
Messages
111
Yeah,I think so. In notepad++ it is,Toee will crash if it isn't. I removed the tabs in the forum post.

def OnNewRoundBegin(attachee, args, evt_obj):
print "Num ticked: " + str(evt_obj.data1)
game.party[0].stat_base_set(stat_strength,66)
return 0

Edit: I copied pymod_example.py to \overrides\scr\tpModifiers and unquoted two prints of BeginRound function, it didn't work as well.
 
Last edited:

btbgfel

Scholar
Joined
Nov 10, 2014
Messages
111
I think I'm not. Do you mean I need use .condition_add() instead of .stat_base_set()? I suck at programming and english.
Even if I deleted the party member modification code and leave just print "Num ticked: " + str(evt_obj.data1), I didn't see it printed anywhere.
 

Sitra Achara

Arcane
Joined
Sep 1, 2003
Messages
1,860
Codex 2012 Codex 2013 Codex 2014 PC RPG Website of the Year, 2015
I think I'm not. Do you mean I need use .condition_add() instead of .stat_base_set()? I suck at programming and english.
Even if I deleted the party member modification code and leave just print "Num ticked: " + str(evt_obj.data1), I didn't see it printed anywhere.

No, I mean to actually add this condition to a charactet, e.g. type in thr console
game.leader. condition_add('ToTestA')
 

btbgfel

Scholar
Joined
Nov 10, 2014
Messages
111
It works.Now do I need to map a modifier to a feat and such, and the modifier will be applied once the feat will chosen? Thanks!

Edit: NVM, I will try it myself.
Edit 2: Yes! It works on a custom feat. Looks like python modifier doesn't work automatically on itself, stupid me. Thanks again!
 
Last edited:

Sitra Achara

Arcane
Joined
Sep 1, 2003
Messages
1,860
Codex 2012 Codex 2013 Codex 2014 PC RPG Website of the Year, 2015
It works.Now do I need to map a modifier to a feat and such, and the modifier will be applied once the feat will chosen? Thanks!

Edit: NVM, I will try it myself.
Edit 2: Yes! It works on a custom feat. Looks like python modifier doesn't work automatically on itself, stupid me. Thanks again!
Pretty cool huh :)
 

IPDT_FE

Novice
Joined
Feb 16, 2018
Messages
13
Hello, I'm new here. I've recently played and won the "vanilla" part of TOEE with Co8 and temple+ mods installed. Being a huge fan of 3.5ed and D&D in general I immediately fell in love with this game and got very interested in modding and adding feats to it.

I've spent the past two days reading the wiki and trying to create a new feat but I can't seem to find any documentation on what the args are supposed to be when extending an existing class ability. I have a feeling I need to trace it back to the source code "under the hood" as you've put it before.

My first project was creating the feat "Extra Rage" but I couldn't figure out how to access the number of rages available per day in the Python Modifiers. As I was browsing the GitHub I was lucky enough to find that someone else had already created a functioning version of the same feat. Starting from this piece of code I was able to figure out that the second parameter sets how many rages you'll have after resting, whereas the first one remains a mystery (changing the value to anything but 0 appears to break the script). My question now is how should I proceed in order to identify what do these parameters represent as many feats actually require expanding on some base version rather than simply creating a new effect.
 

Sitra Achara

Arcane
Joined
Sep 1, 2003
Messages
1,860
Codex 2012 Codex 2013 Codex 2014 PC RPG Website of the Year, 2015
Hello, I'm new here. I've recently played and won the "vanilla" part of TOEE with Co8 and temple+ mods installed. Being a huge fan of 3.5ed and D&D in general I immediately fell in love with this game and got very interested in modding and adding feats to it.

I've spent the past two days reading the wiki and trying to create a new feat but I can't seem to find any documentation on what the args are supposed to be when extending an existing class ability. I have a feeling I need to trace it back to the source code "under the hood" as you've put it before.

My first project was creating the feat "Extra Rage" but I couldn't figure out how to access the number of rages available per day in the Python Modifiers. As I was browsing the GitHub I was lucky enough to find that someone else had already created a functioning version of the same feat. Starting from this piece of code I was able to figure out that the second parameter sets how many rages you'll have after resting, whereas the first one remains a mystery (changing the value to anything but 0 appears to break the script). My question now is how should I proceed in order to identify what do these parameters represent as many feats actually require expanding on some base version rather than simply creating a new effect.
Welcome!
For existing hardcoded feats there is no sure way to tell other than reverse engineering the code, which isn't that hard actually now that we have most of the gameplay code mapped out. Send me a PM if interested.

Other than that I can say in general that feat args often contain some of the following:
Number of rounds remaining
Particle system ID (for feats that create particle effects - this is the case with Barb rage)
Area of Effect ID
Sub-feat enum (e.g. Weapon specialization)
Object handle (when the feat needs an object reference; spans two args)
Object ID (when the feat needs to retain an object reference across saves and maps, it converts to ObjID and stores it; spans 4 args)

And then there can also be feat specific state keeping.
 

IPDT_FE

Novice
Joined
Feb 16, 2018
Messages
13
I'm a new user here so I don't think I have pming privileges yet, but I'm very interested in checking out the workings.

Right now I'm coding extra smiting which I believe would reasonably work in a very similar way to extra rage but I can't get the function to fire on the hook ET_OnNewDay, EK_NEWDAY_REST. On the condition list smite evil (without hyphen nor underscore) currently has an entry for NewDay | DK_NEWDAY_REST but my print line in the function is never called leading me to believe the whole function isn't called at all.

I'll attach the code here
#Extra Smiting: Complete Warrior, p. 98

from templeplus.pymod import PythonModifier
from toee import *
import tpdp

print "Registering Extra Smiting"

def ESNewDay(attachee, args, evt_obj):
ExtraSmitingCount = attachee.has_feat("Extra Smiting")
print "rested"
#Extra Smiting grants 2 additional uses of smite each time the feat is taken
args.set_arg(0, args.get_arg(0) + 2)
return 0

eSF = PythonModifier()
eSF.ExtendExisting("Smite Evil")
eSF.AddHook(ET_OnNewDay, EK_NEWDAY_REST, ESNewDay, ())

My second question is if unique files that I created in the rules and scr folder will be modified when a patch hits even if you're not directly altering them and I should therefore place my extra rage and extra smiting in the override folders.

My third question is where should I upload the feats I created if you were interested in actually adding them to the game.
 

As an Amazon Associate, rpgcodex.net earns from qualifying purchases.
Back
Top Bottom