Kaidon Jorn 195 Posted July 1, 2015 Ok, I need help from some expert scripters. I should preface this by saying I have started reading and trying to apply my little knowledge in making a new force power. So, what I want to do is basically turn all the schematics in my SLM mod into a new usable item (baseitems.2da) that when clicked on, will cast the spell, much like say, an adrenaline shot ( and not a forearm band cause I dont want you to have to equip the thing). I have been able to use KGFF to point the base item to my new line in base items.2da. And it does show up like an adrenaline shot inthe scrollable items on bottom left of screen in game. So I first need to complete the script for a new force power, right? Which if complied correctly, would show up when using KotOR tools uti editor, correct? So then if I change the .uti of the schematic, the base item of my new item would be selectable (or activate item would be used) and the subtype(spell) would show up and be selectable as well, correct? Anyway, I think the first step would be to get the new spell running correctly, so any help I could get would be great. This is basically what I need the spell to do. ...basically. Now I completely realize that I'm probably going about it entirely the wrong way, so if anyone could give me a clue or give me insight into how I should actually be thinking about this I would be most grateful. Oh and the send message to pc part I would rather have be in a pop up display message box, but Im not sure how that function works. void main() { object oPC = GetFirstPC(); object oScheme = GetObjectByTag("alde_scheme", 0); if ((GetIsObjectValid(GetItemPossessedBy(oPC, "alde_scheme"))) && (GetGlobalBoolean("Sch_Alde_Learned") == 0)) { SetGlobalBoolean("Sch_Alde_Learned", 1); SendMessageToPC(oPC, "Alderaanian Battle Saber Schematic Learned!"); DestroyObject(oScheme, 0.0, 0, 0.0, 0); } else { object oScheme = GetObjectByTag("cbat_scheme", 0); if ((GetIsObjectValid(GetItemPossessedBy(oPC, "cbat_scheme"))) && (GetGlobalBoolean("Sch_Cbat_Learned") == 0)) { SetGlobalBoolean("Sch_Cbat_Learned", 1); SendMessageToPC(oPC, "Consular's Battle Saber Schematic Learned!"); DestroyObject(oScheme, 0.0, 0, 0.0, 0); } else { object oScheme = GetObjectByTag("enfo_scheme", 0); if ((GetIsObjectValid(GetItemPossessedBy(oPC, "enfo_scheme"))) && (GetGlobalBoolean("Sch_Enfo_Learned") == 0)) { SetGlobalBoolean("Sch_Enfo_Learned", 1); SendMessageToPC(oPC, "Enforcer's Saberstaff Schematic Learned!"); DestroyObject(oScheme, 0.0, 0, 0.0, 0); } else { object oScheme = GetObjectByTag("sinq_scheme", 0); if ((GetIsObjectValid(GetItemPossessedBy(oPC, "sinq_scheme"))) && (GetGlobalBoolean("Sch_Sinq_Learned") == 0)) { SetGlobalBoolean("Sch_Sinq_Learned", 1); SendMessageToPC(oPC, "Supreme Inquisitor's Lightsaber Schematic Learned!"); DestroyObject(oScheme, 0.0, 0, 0.0, 0); } else { object oScheme = GetObjectByTag("stal_scheme", 0); if ((GetIsObjectValid(GetItemPossessedBy(oPC, "stal_scheme"))) && (GetGlobalBoolean("Sch_Stal_Learned") == 0)) { SetGlobalBoolean("Sch_Stal_Learned", 1); SendMessageToPC(oPC, "War Stalker's Saberstaff Schematic Learned!"); DestroyObject(oScheme, 0.0, 0, 0.0, 0); } else { object oScheme = GetObjectByTag("ckni_scheme", 0); if ((GetIsObjectValid(GetItemPossessedBy(oPC, "ckni_scheme"))) && (GetGlobalBoolean("Sch_Ckni_Learned") == 0)) { SetGlobalBoolean("Sch_Ckni_Learned", 1); SendMessageToPC(oPC, "Coruscant Knight's Lightsaber Schematic Learned!"); DestroyObject(oScheme, 0.0, 0, 0.0, 0); } else { object oScheme = GetObjectByTag("shdw_scheme", 0); if ((GetIsObjectValid(GetItemPossessedBy(oPC, "shdw_scheme"))) && (GetGlobalBoolean("Sch_Shdw_Learned") == 0)) { SetGlobalBoolean("Sch_Shdw_Learned", 1); SendMessageToPC(oPC, "Shadow's Meditation Saberstaff Schematic Learned!"); DestroyObject(oScheme, 0.0, 0, 0.0, 0); } else { object oScheme = GetObjectByTag("lead_scheme", 0); if ((GetIsObjectValid(GetItemPossessedBy(oPC, "lead_scheme"))) && (GetGlobalBoolean("Sch_Lead_Learned") == 0)) { SetGlobalBoolean("Sch_Lead_Learned", 1); SendMessageToPC(oPC, "Mandalorian War Leader's Lightsaber Schematic Learned!"); DestroyObject(oScheme, 0.0, 0, 0.0, 0); } else { object oScheme = GetObjectByTag("dres_scheme", 0); if ((GetIsObjectValid(GetItemPossessedBy(oPC, "dres_scheme"))) && (GetGlobalBoolean("Sch_Dres_Learned") == 0)) { SetGlobalBoolean("Sch_Dres_Learned", 1); SendMessageToPC(oPC, "Dreshdae Lord's Lightsaber Schematic Learned!"); DestroyObject(oScheme, 0.0, 0, 0.0, 0); } else { object oScheme = GetObjectByTag("sage_scheme", 0); if ((GetIsObjectValid(GetItemPossessedBy(oPC, "sage_scheme"))) && (GetGlobalBoolean("Sch_Sage_Learned") == 0)) { SetGlobalBoolean("Sch_Sage_Learned", 1); SendMessageToPC(oPC, "Enlightened Sage's Lightsaber Schematic Learned!"); DestroyObject(oScheme, 0.0, 0, 0.0, 0); } else { object oScheme = GetObjectByTag("egrd_scheme", 0); if ((GetIsObjectValid(GetItemPossessedBy(oPC, "egrd_scheme"))) && (GetGlobalBoolean("Sch_Egrd_Learned") == 0)) { SetGlobalBoolean("Sch_Egrd_Learned", 1); SendMessageToPC(oPC, "Enclave Guardian's Lightsaber Schematic Learned!"); DestroyObject(oScheme, 0.0, 0, 0.0, 0); } else { object oScheme = GetObjectByTag("raid_scheme", 0); if ((GetIsObjectValid(GetItemPossessedBy(oPC, "raid_scheme"))) && (GetGlobalBoolean("Sch_Raid_Learned") == 0)) { SetGlobalBoolean("Sch_Raid_Learned", 1); SendMessageToPC(oPC, "Sith Raider's Lightsaber Schematic Learned!"); DestroyObject(oScheme, 0.0, 0, 0.0, 0); } else { object oScheme = GetObjectByTag("dvet_scheme", 0); if ((GetIsObjectValid(GetItemPossessedBy(oPC, "dvet_scheme"))) && (GetGlobalBoolean("Sch_Dvet_Learned") == 0)) { SetGlobalBoolean("Sch_Dvet_Learned", 1); SendMessageToPC(oPC, "Dxun Veteran's Lightsaber Schematic Learned!"); DestroyObject(oScheme, 0.0, 0, 0.0, 0); } } } } } } } } } } } } } } Quote Share this post Link to post Share on other sites
Kaidon Jorn 195 Posted July 1, 2015 And I was able to get it to compile - now the question is how do I get an item to cast the spell? I got it to show up as a selectable spell in KSE here is my updated script that I just took from an old tutorial of beancounter's and cut off the parts I wouldn't need... #include "k_inc_force" int FORCE_POWER_LEARN_SCHEMATIC = 284; void main() { object oTarget = GetSpellTargetObject(); object oPC = GetFirstPC(); effect eTargetVisual; effect eBuff; SWFP_HARMFUL = FALSE; SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, GetSpellId(), SWFP_HARMFUL)); eBuff = SetEffectIcon(eBuff, 7); eTargetVisual = EffectVisualEffect(VFX_PRO_FORCE_ARMOR); eTargetVisual = EffectLinkEffects(eTargetVisual, EffectVisualEffect(VFX_PRO_FORCE_ARMOR)); object oScheme = GetObjectByTag("alde_scheme", 0); if ((GetIsObjectValid(GetItemPossessedBy(oPC, "alde_scheme"))) && (GetGlobalBoolean("Sch_Alde_Learned") == 0)) { SetGlobalBoolean("Sch_Alde_Learned", 1); SendMessageToPC(oPC, "Alderaanian Battle Saber Schematic Learned!"); DestroyObject(oScheme, 0.0, 0, 0.0, 0); } else { object oScheme = GetObjectByTag("cbat_scheme", 0); if ((GetIsObjectValid(GetItemPossessedBy(oPC, "cbat_scheme"))) && (GetGlobalBoolean("Sch_Cbat_Learned") == 0)) { SetGlobalBoolean("Sch_Cbat_Learned", 1); SendMessageToPC(oPC, "Consular's Battle Saber Schematic Learned!"); DestroyObject(oScheme, 0.0, 0, 0.0, 0); } else { object oScheme = GetObjectByTag("enfo_scheme", 0); if ((GetIsObjectValid(GetItemPossessedBy(oPC, "enfo_scheme"))) && (GetGlobalBoolean("Sch_Enfo_Learned") == 0)) { SetGlobalBoolean("Sch_Enfo_Learned", 1); SendMessageToPC(oPC, "Enforcer's Saberstaff Schematic Learned!"); DestroyObject(oScheme, 0.0, 0, 0.0, 0); } else { object oScheme = GetObjectByTag("sinq_scheme", 0); if ((GetIsObjectValid(GetItemPossessedBy(oPC, "sinq_scheme"))) && (GetGlobalBoolean("Sch_Sinq_Learned") == 0)) { SetGlobalBoolean("Sch_Sinq_Learned", 1); SendMessageToPC(oPC, "Supreme Inquisitor's Lightsaber Schematic Learned!"); DestroyObject(oScheme, 0.0, 0, 0.0, 0); } else { object oScheme = GetObjectByTag("stal_scheme", 0); if ((GetIsObjectValid(GetItemPossessedBy(oPC, "stal_scheme"))) && (GetGlobalBoolean("Sch_Stal_Learned") == 0)) { SetGlobalBoolean("Sch_Stal_Learned", 1); SendMessageToPC(oPC, "War Stalker's Saberstaff Schematic Learned!"); DestroyObject(oScheme, 0.0, 0, 0.0, 0); } else { object oScheme = GetObjectByTag("ckni_scheme", 0); if ((GetIsObjectValid(GetItemPossessedBy(oPC, "ckni_scheme"))) && (GetGlobalBoolean("Sch_Ckni_Learned") == 0)) { SetGlobalBoolean("Sch_Ckni_Learned", 1); SendMessageToPC(oPC, "Coruscant Knight's Lightsaber Schematic Learned!"); DestroyObject(oScheme, 0.0, 0, 0.0, 0); } else { object oScheme = GetObjectByTag("shdw_scheme", 0); if ((GetIsObjectValid(GetItemPossessedBy(oPC, "shdw_scheme"))) && (GetGlobalBoolean("Sch_Shdw_Learned") == 0)) { SetGlobalBoolean("Sch_Shdw_Learned", 1); SendMessageToPC(oPC, "Shadow's Meditation Saberstaff Schematic Learned!"); DestroyObject(oScheme, 0.0, 0, 0.0, 0); } else { object oScheme = GetObjectByTag("lead_scheme", 0); if ((GetIsObjectValid(GetItemPossessedBy(oPC, "lead_scheme"))) && (GetGlobalBoolean("Sch_Lead_Learned") == 0)) { SetGlobalBoolean("Sch_Lead_Learned", 1); SendMessageToPC(oPC, "Mandalorian War Leader's Lightsaber Schematic Learned!"); DestroyObject(oScheme, 0.0, 0, 0.0, 0); } else { object oScheme = GetObjectByTag("dres_scheme", 0); if ((GetIsObjectValid(GetItemPossessedBy(oPC, "dres_scheme"))) && (GetGlobalBoolean("Sch_Dres_Learned") == 0)) { SetGlobalBoolean("Sch_Dres_Learned", 1); SendMessageToPC(oPC, "Dreshdae Lord's Lightsaber Schematic Learned!"); DestroyObject(oScheme, 0.0, 0, 0.0, 0); } else { object oScheme = GetObjectByTag("sage_scheme", 0); if ((GetIsObjectValid(GetItemPossessedBy(oPC, "sage_scheme"))) && (GetGlobalBoolean("Sch_Sage_Learned") == 0)) { SetGlobalBoolean("Sch_Sage_Learned", 1); SendMessageToPC(oPC, "Enlightened Sage's Lightsaber Schematic Learned!"); DestroyObject(oScheme, 0.0, 0, 0.0, 0); } else { object oScheme = GetObjectByTag("egrd_scheme", 0); if ((GetIsObjectValid(GetItemPossessedBy(oPC, "egrd_scheme"))) && (GetGlobalBoolean("Sch_Egrd_Learned") == 0)) { SetGlobalBoolean("Sch_Egrd_Learned", 1); SendMessageToPC(oPC, "Enclave Guardian's Lightsaber Schematic Learned!"); DestroyObject(oScheme, 0.0, 0, 0.0, 0); } else { object oScheme = GetObjectByTag("raid_scheme", 0); if ((GetIsObjectValid(GetItemPossessedBy(oPC, "raid_scheme"))) && (GetGlobalBoolean("Sch_Raid_Learned") == 0)) { SetGlobalBoolean("Sch_Raid_Learned", 1); SendMessageToPC(oPC, "Sith Raider's Lightsaber Schematic Learned!"); DestroyObject(oScheme, 0.0, 0, 0.0, 0); } else { object oScheme = GetObjectByTag("dvet_scheme", 0); if ((GetIsObjectValid(GetItemPossessedBy(oPC, "dvet_scheme"))) && (GetGlobalBoolean("Sch_Dvet_Learned") == 0)) { SetGlobalBoolean("Sch_Dvet_Learned", 1); SendMessageToPC(oPC, "Dxun Veteran's Lightsaber Schematic Learned!"); DestroyObject(oScheme, 0.0, 0, 0.0, 0); } ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eTargetVisual, oTarget, 3.0); ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eBuff, oTarget, 60.0); } } } } } } } } } } } } } Quote Share this post Link to post Share on other sites
Fair Strides 509 Posted July 1, 2015 EDIT: I started writing this before you posted your second post. Okay, A bit of help here: You can enable an option in KotOR Tool's Options menu to check the Override folder for .2da files. For a new baseitem to show up in KT, you'd need this option enabled and the edited baseitems.2da in your override folder. This also applies for your spell in the ActivateItem property (you'd need the line added to spells.2da and put your script to activate in the impactscript entry). As to your script itself, you might try this: void main() { object oPC = GetFirstPC(); object oScheme = OBJECT_INVALID; string sTag = ""; string sBoolean = ""; string sMessage = ""; int iCounter; for(iCounter = 1; iCounter <= 13; iCounter++) { switch(iCounter) { case 1: { sTag = "alde_scheme"; sBoolean = "Sch_Alde_Learned"; sMessage = "Alderaanian Battle Saber"; break; } case 2: { sTag = "cbat_scheme"; sBoolean = "Sch_Cbat_Learned"; sMessage = "Consular's Battle Saber"; break; } case 3: { sTag = "enfo_scheme"; sBoolean = "Sch_Enfo_Learned"; sMessage = "Enforcer's Saberstaff"; break; } case 4: { sTag = "sing_scheme"; sBoolean = "Sch_Sing_Learned"; sMessage = "Sith Inquisitor's Lightsaber"; break; } case 5: { sTag = "stal_scheme"; sBoolean = "Sch_Stal_Learned"; sMessage = "War Stalker's Saberstaff"; break; } case 6: { sTag = "ckni_scheme"; sBoolean = "Sch_Ckni_Learned"; sMessage = "Coruscant Knight's Lightsaber"; break; } case 7: { sTag = "shdw_scheme"; sBoolean = "Sch_Shdw_Learned"; sMessage = "Shadow's Meditation Saberstaff"; break; } case 8: { sTag = "lead_scheme"; sBoolean = "Sch_Lead_Learned"; sMessage = "Mandalorian War Leader's Lightsaber"; break; } case 9: { sTag = "dres_scheme"; sBoolean = "Sch_Dres_Learned"; sMessage = "Dreshdae Lord's Lightsaber"; break; } case 10: { sTag = "sage_scheme"; sBoolean = "Sch_Sage_Learned"; sMessage = "Enlightened Sage's Lightsaber"; break; } case 11: { sTag = "egrd_scheme"; sBoolean = "Sch_Egrd_Learned"; sMessage = "Enclave Guardian's Lightsaber"; break; } case 12: { sTag = "raid_scheme"; sBoolean = "Sch_Raid_Learned"; sMessage = "Sith Raider's Lightsaber"; break; } case 13: { sTag = "dvet_scheme"; sBoolean = "Sch_Dvet_Learned"; sMessage = "Dxun Veteran's Lightsaber"; break; } } oScheme = GetItemPossessedBy(oPC, sTag); if(GetIsObjectValid(oScheme) == 1 && GetGlobalBoolean(sBoolean) == 0) { SetGlobalBoolean(sBoolean, 1); SetCustomToken(50001, sMessage); DestroyObject(oScheme); AssignCommand(oPC, ActionStartConversation(oPC, "kj_scheme")); iCounter = 14; } } } And here's the dlg and scripts for that example: Basically what the script does is loop through the same code 13 times (since you currently have 13 saber schematics) and depending on which number, it selects the tag, boolean name, and saber name and then runs the code to check if you have the item, the variable is not set, and you need to set the variable and give a popup. Once a match is found, the variable for the loop is set to 14 so that the loop stops immediately. This even works if they have more than one schematic on them; they'll have to run the script for each schematic. And this script is easily expanded by changing the iCounter Quote Share this post Link to post Share on other sites
Kaidon Jorn 195 Posted July 1, 2015 DUDE you are a Godsend.. ha, I had actually started thinking about how to possibly make it a feat instead. Aight thanks a bunch, let me see what I can do with this. Oh hey, would I still need to #include "k_inc_force"int FORCE_POWER_LEARN_SCHEMATIC = 284; at the top of the script? Quote Share this post Link to post Share on other sites
Fair Strides 509 Posted July 1, 2015 Okay, now as a moderator, I need to warn you about double-posting. Rule 8, Section 6, and the supplementary thread. As to your question, you shouldn't have to. That's only needed if you're running multiple "spells" from the same script (like in k_inc_force). Since this is a separate script entirely (assuming you're not putting k_inc_force as the impactscript in the spells.2da), then that isn't needed. Quote Share this post Link to post Share on other sites
Kaidon Jorn 195 Posted July 1, 2015 Okay, now as a moderator, I need to warn you about double-posting. Rule 8, Section 6, and the supplementary thread. As to your question, you shouldn't have to. That's only needed if you're running multiple "spells" from the same script (like in k_inc_force). Since this is a separate script entirely (assuming you're not putting k_inc_force as the impactscript in the spells.2da), then that isn't needed. Ok sorry got all excited lol. And ok thanks!! I think i see better what im doing, I am seeing if I can make it a clickable plot usable item and messing with the icon for it at the moment. Quote Share this post Link to post Share on other sites
Kaidon Jorn 195 Posted July 3, 2015 Hey there, Been working on this new schematic thing for a couple of days, and am feeling like it's just about where I want it to be. The only thing keeping me from starting to rebuild the tslpatcher is the end of the learn schematic force power script, because I really really wanted it to display pop up message box rather than the small dialog box it does now. (Thanks again FS) I have this "power" working well I think, but need to know how to use the DisplayMessageBox function. The parameters are (int nStrRef, sIcon = "") I didn't want to change the way the script is set up if I didn't have to but I have a type mismatch in compiler because the message is a string, not a number. before I post the script I wanted to find out where the spoiler tag button is on here. I really really dont see it anywhere. Help? Quote Share this post Link to post Share on other sites
Fair Strides 509 Posted July 3, 2015 Hey there, Been working on this new schematic thing for a couple of days, and am feeling like it's just about where I want it to be. The only thing keeping me from starting to rebuild the tslpatcher is the end of the learn schematic force power script, because I really really wanted it to display pop up message box rather than the small dialog box it does now. (Thanks again FS) I have this "power" working well I think, but need to know how to use the DisplayMessageBox function. The parameters are (int nStrRef, sIcon = "") I didn't want to change the way the script is set up if I didn't have to but I have a type mismatch in compiler because the message is a string, not a number. before I post the script I wanted to find out where the spoiler tag button is on here. I really really dont see it anywhere. Help? The spoiler tags thing isn't a button on here (no clue why), but if you write "spoiler" and "/spoiler" (without the quotes) and surround them with [ ] (without the space between them), then it should work. As to your scripting question, the DisplayMessageBox function takes a String Reference from the dialog.tlk. For experimentation purposes, you might add a new TLK entry to your dialog.tlk using TalkEd, which came with the TSLPatcher. And no, I don't know if the icon thing works, but knock yourself out. Quote Share this post Link to post Share on other sites
Kaidon Jorn 195 Posted July 3, 2015 The spoiler tags thing isn't a button on here (no clue why), but if you write "spoiler" and "/spoiler" (without the quotes) and surround them with [ ] (without the space between them), then it should work. As to your scripting question, the DisplayMessageBox function takes a String Reference from the dialog.tlk. For experimentation purposes, you might add a new TLK entry to your dialog.tlk using TalkEd, which came with the TSLPatcher. And no, I don't know if the icon thing works, but knock yourself out. Yeah it does. Ok let me test this spoiler command.. void main() { object oPC = GetFirstPC(); object object3 = OBJECT_INVALID; string string1 = ""; string string2 = ""; string string3 = ""; string string4 = ""; int int1 = 1; while ((int1 <= 13)) { switch (int1) { case 1: string1 = "alde_scheme"; string2 = "learned_alde"; string3 = "Learned Alderaanian Battle Saber!"; string4 = "ip_scheme"; break; case 2: string1 = "cbat_scheme"; string2 = "learned_cbat"; string3 = "Learned Consular's Battle Saber!"; string4 = "ip_scheme"; break; case 3: string1 = "enfo_scheme"; string2 = "learned_enfo"; string3 = "Learned Enforcer's Saberstaff!"; string4 = "ip_scheme"; break; case 4: string1 = "sinq_scheme"; string2 = "learned_sinq"; string3 = "Learned Sith Inquisitor's Lightsaber!"; string4 = "ip_scheme"; break; case 5: string1 = "stal_scheme"; string2 = "learned_stal"; string3 = "Learned War Stalker's Saberstaff!"; string4 = "ip_scheme"; break; case 6: string1 = "ckni_scheme"; string2 = "learned_ckni"; string3 = "Learned Coruscant Knight's Lightsaber!"; string4 = "ip_scheme"; break; case 7: string1 = "shdw_scheme"; string2 = "learned_shdw"; string3 = "Learned Shadow's Meditation Saberstaff!"; string4 = "ip_scheme"; break; case 8: string1 = "lead_scheme"; string2 = "learned_lead"; string3 = "Learned Mandalorian War Leader's Lightsaber!"; string4 = "ip_scheme"; break; case 9: string1 = "dres_scheme"; string2 = "learned_dres"; string3 = "Learned Dreshdae Lord's Lightsaber!"; string4 = "ip_scheme"; break; case 10: string1 = "sage_scheme"; string2 = "learned_sage"; string3 = "Learned Enlightened Sage's Lightsaber!"; string4 = "ip_scheme"; break; case 11: string1 = "egrd_scheme"; string2 = "learned_egrd"; string3 = "Learned Enclave Guardian's Lightsaber!"; string4 = "ip_scheme"; break; case 12: string1 = "raid_scheme"; string2 = "learned_raid"; string3 = "Learned Sith Raider's Lightsaber!"; string4 = "ip_scheme"; break; case 13: string1 = "dvet_scheme"; string2 = "learned_dvet"; string3 = "Learned Dxun Veteran's Lightsaber!"; string4 = "ip_scheme"; break; } object3 = GetItemPossessedBy(oPC, string1); { effect efVisual = EffectVisualEffect(1010, 0); if (((GetIsObjectValid(object3) == 1) && (GetGlobalBoolean(string2) == 0))) { SetGlobalBoolean(string2, 1); ApplyEffectToObject(1, efVisual, oPC, 3.0); DisplayMessageBox(int2??, string4); int1 = 14; } } (int1++); } } So about the script, looks like I would have to take out the string3 command and declare an int2 to point to my dialog.tlk lines? (which i've already done actually) Aight forget it, Guess whoever is in command over there will have to put in a spoiler button. You would THINK..... Quote Share this post Link to post Share on other sites
Fair Strides 509 Posted July 3, 2015 Yeah, that sounds about right. Also, you forgot the ] on the spoiler and the [ on the /spoiler. EDIT: This being the case, you can probably add onto your case statements by keeping the "int2" in your DisplayMessageBox function and add this to your case statements: int2 = ; And in the TSLPatcher, I think you can have it process the script and if you do #StringRefmight replace those with your new dialog.tlk entries. Quote Share this post Link to post Share on other sites
Kaidon Jorn 195 Posted July 3, 2015 Yeah, that sounds about right. Also, you forgot the ] on the spoiler and the [ on the /spoiler. EDIT: This being the case, you can probably add onto your case statements by keeping the "int2" in your DisplayMessageBox function and add this to your case statements: int2 = <number of tlk line>; And in the TSLPatcher, I think you can have it process the script and if you do #StringRef<number# for each of your TLK references, then it might replace those with your new dialog.tlk entries. Ok thanks, have alot to do now hahaha I think I know what you mean with tslpatcher, but Im going to read up on that cause I've forgotten most of what I used to know. Quote Share this post Link to post Share on other sites
Fair Strides 509 Posted July 3, 2015 Ok thanks, have alot to do now hahaha I think I know what you mean with tslpatcher, but Im going to read up on that cause I've forgotten most of what I used to know. Well, as far adding the int2 thing, I'd just add that at the bottom of the case block, on a new line before the break; line. And for the DisplayMessageBox thing, you might want to delete the two ?? after the int2. Quote Share this post Link to post Share on other sites
Kaidon Jorn 195 Posted July 3, 2015 Oh yeah, of course, I just put that there so you'd know I was questioning it. And I just tried to compile it and there is an error in the case statements at < So, int int2 should equal ""; up top where you are declaring strings and objects? Oh wait, did the .tlk lines need to have <> around them or no? just put the number? Quote Share this post Link to post Share on other sites
Fair Strides 509 Posted July 3, 2015 Just put the number. And the int2 at the top should be int int2 = 0; Quote Share this post Link to post Share on other sites
Kaidon Jorn 195 Posted July 3, 2015 (edited) Thats it! GOT IT Yeeesssss! message box popped up, Had a stray int in case 13 that i forgot to remove, but after that it compiled fine. THANKS FS!! Now to tweak some more and learn about how to install this with tslpatcher. So the final script looks like this... void main() { object oPC = GetFirstPC(); object object3 = OBJECT_INVALID; string string1 = ""; string string2 = ""; string string3 = ""; int int2 = 0; int int1 = 1; while ((int1 <= 13)) { switch (int1) { case 1: string1 = "alde_scheme"; string2 = "learned_alde"; string3 = "ip_scheme"; int2 = 136380; break; case 2: string1 = "cbat_scheme"; string2 = "learned_cbat"; string3 = "ip_scheme"; int2 = 136381; break; case 3: string1 = "enfo_scheme"; string2 = "learned_enfo"; string3 = "ip_scheme"; int2 = 136386; break; case 4: string1 = "sinq_scheme"; string2 = "learned_sinq"; string3 = "ip_scheme"; int2 = 136391; break; case 5: string1 = "stal_scheme"; string2 = "learned_stal"; string3 = "ip_scheme"; int2 = 136392; break; case 6: string1 = "ckni_scheme"; string2 = "learned_ckni"; string3 = "ip_scheme"; int2 = 136382; break; case 7: string1 = "shdw_scheme"; string2 = "learned_shdw"; string3 = "ip_scheme"; int2 = 136390; break; case 8: string1 = "lead_scheme"; string2 = "learned_lead"; string3 = "ip_scheme"; int2 = 136388; break; case 9: string1 = "dres_scheme"; string2 = "learned_dres"; string3 = "ip_scheme"; int2 = 136383; break; case 10: string1 = "sage_scheme"; string2 = "learned_sage"; string3 = "ip_scheme"; int2 = 136387; break; case 11: string1 = "egrd_scheme"; string2 = "learned_egrd"; string3 = "ip_scheme"; int2 = 136385; break; case 12: string1 = "raid_scheme"; string2 = "learned_raid"; string3 = "ip_scheme"; int2 = 136389; break; case 13: string1 = "dvet_scheme"; string2 = "learned_dvet"; string3 = "ip_scheme"; int2 = 136384; break; } object3 = GetItemPossessedBy(oPC, string1); { effect efVisual = EffectVisualEffect(1010, 0); if (((GetIsObjectValid(object3) == 1) && (GetGlobalBoolean(string2) == 0))) { SetGlobalBoolean(string2, 1); ApplyEffectToObject(1, efVisual, oPC, 3.0); DisplayMessageBox(int2, string3); int1 = 14; } } (int1++); } } Edited July 3, 2015 by Kaidon Jorn Quote Share this post Link to post Share on other sites
VarsityPuppet 1,085 Posted July 3, 2015 Thats it! GOT IT Yeeesssss! message box popped up, Had a stray int in case 13 that i forgot to remove, but after that it compiled fine. THANKS FS!! Now to tweak some more and learn about how to install this with tslpatcher. So the final script looks like this... void main() { object oPC = GetFirstPC(); object object3 = OBJECT_INVALID; string string1 = ""; string string2 = ""; string string3 = ""; int int2 = 0; int int1 = 1; while ((int1 <= 13)) { switch (int1) { case 1: string1 = "alde_scheme"; string2 = "learned_alde"; string3 = "ip_scheme"; int2 = 136380; break; case 2: string1 = "cbat_scheme"; string2 = "learned_cbat"; string3 = "ip_scheme"; int2 = 136381; break; case 3: string1 = "enfo_scheme"; string2 = "learned_enfo"; string3 = "ip_scheme"; int2 = 136386; break; case 4: string1 = "sinq_scheme"; string2 = "learned_sinq"; string3 = "ip_scheme"; int2 = 136391; break; case 5: string1 = "stal_scheme"; string2 = "learned_stal"; string3 = "ip_scheme"; int2 = 136392; break; case 6: string1 = "ckni_scheme"; string2 = "learned_ckni"; string3 = "ip_scheme"; int2 = 136382; break; case 7: string1 = "shdw_scheme"; string2 = "learned_shdw"; string3 = "ip_scheme"; int2 = 136390; break; case 8: string1 = "lead_scheme"; string2 = "learned_lead"; string3 = "ip_scheme"; int2 = 136388; break; case 9: string1 = "dres_scheme"; string2 = "learned_dres"; string3 = "ip_scheme"; int2 = 136383; break; case 10: string1 = "sage_scheme"; string2 = "learned_sage"; string3 = "ip_scheme"; int2 = 136387; break; case 11: string1 = "egrd_scheme"; string2 = "learned_egrd"; string3 = "ip_scheme"; int2 = 136385; break; case 12: string1 = "raid_scheme"; string2 = "learned_raid"; string3 = "ip_scheme"; int2 = 136389; break; case 13: string1 = "dvet_scheme"; string2 = "learned_dvet"; string3 = "ip_scheme"; int2 = 136384; break; } object3 = GetItemPossessedBy(oPC, string1); { effect efVisual = EffectVisualEffect(1010, 0); if (((GetIsObjectValid(object3) == 1) && (GetGlobalBoolean(string2) == 0))) { SetGlobalBoolean(string2, 1); ApplyEffectToObject(1, efVisual, oPC, 3.0); DisplayMessageBox(int2, string3); int1 = 14; } } (int1++); } } Probably don't need to set the value of string3 in every case. You should do string string3 = "ip_scheme" up at the top, then you don't need to set it in each case statement Quote Share this post Link to post Share on other sites
Kaidon Jorn 195 Posted July 3, 2015 Probably don't need to set the value of string3 in every case. You should do string string3 = "ip_scheme" up at the top, then you don't need to set it in each case statement ok yeah gotcha.. I knew that Quote Share this post Link to post Share on other sites
Kaidon Jorn 195 Posted July 4, 2015 Ok, working on something else now,.. Has anyone here ever used CreateItemOnFloor();? void main () { CreateItemOnFloor("pera_lghtsbr_018", Location(Vector((-3.83941), (-6.33198), 0.796), 0.00057), 0); } Had to get the Location parameters right but got those and it compiled fine. Re ran the module (153HAR) but it didn't fire. Running it from 153Atton.dlg, in the Kreia/Sion cutscene. Wanted to see if I could get her saber to drop down next to her after Sion cuts her hand off. Just one of those little details I like to do if possible. Quote Share this post Link to post Share on other sites
Fair Strides 509 Posted July 4, 2015 You might add a SendMessageToPC(GetFirstPC(), "I fired!"); to the script. Also, going by the Z-coordinate, you're spawning the item about 80 CM off the ground, so it might or might not be visible with the cameras... Quote Share this post Link to post Share on other sites
Kaidon Jorn 195 Posted July 4, 2015 (edited) Ok, I did actually copy/paste the location(vector) parameters from a_visasarrives from 003EBO lol. I'll mess with the script some more. Alright, well that won't work. I dont think that CreateItemOnFloor function works at all. And CreateObject() either needs to be placeable, creature or waypoint. Gave up and moving on. Edited July 4, 2015 by Kaidon Jorn Quote Share this post Link to post Share on other sites
Fair Strides 509 Posted July 4, 2015 Ok, I did actually copy/paste the location(vector) parameters from a_visasarrives from 003EBO lol. I'll mess with the script some more. Alright, well that won't work. I dont think that CreateItemOnFloor function works at all. And CreateObject() either needs to be placeable, creature or waypoint. Gave up and moving on. Are you sure? // 243: Create an object of the specified type at lLocation. // - nObjectType: OBJECT_TYPE_ITEM, OBJECT_TYPE_CREATURE, OBJECT_TYPE_PLACEABLE, // OBJECT_TYPE_STORE // - sTemplate // - lLocation // - bUseAppearAnimation // Waypoints can now also be created using the CreateObject function. // nObjectType is: OBJECT_TYPE_WAYPOINT // sTemplate will be the tag of the waypoint // lLocation is where the waypoint will be placed // bUseAppearAnimation is ignored object CreateObject(int nObjectType, string sTemplate, location lLocation, int bUseAppearAnimation=FALSE); Quote Share this post Link to post Share on other sites
Kaidon Jorn 195 Posted July 4, 2015 Oh dude, I just thought of another possible way. CreateItemOnObject if the object is the waypoint? I shouldn't need to create the waypoint because the .git takes care of that. Put my coordinates in there with a .utw But then do CreateItemOnObject for the saber onthe waypoint? or would that not work either? Or- maybe 2 CreateObject's in the same coordiante? The waypoint and the saber? Quote Share this post Link to post Share on other sites
Fair Strides 509 Posted July 4, 2015 I think the CreateItemOnObject just adds it to Inventory, which the waypoints don't have. Worst-case scenario, you could just make a placeable version of the lightsaber. Quote Share this post Link to post Share on other sites
Kaidon Jorn 195 Posted July 5, 2015 I think the CreateItemOnObject just adds it to Inventory, which the waypoints don't have. Worst-case scenario, you could just make a placeable version of the lightsaber. Ewwww... thought of that too, was trying to avoid it. Quote Share this post Link to post Share on other sites
Fair Strides 509 Posted July 5, 2015 If it makes you feel better, you can make the placeable not de-render by either adding two "lookat" dummies, one off to either side of it, or by not including a "lookat" dummy... Quote Share this post Link to post Share on other sites