lfnetwork.com mark read register faq members calendar

Thread: Qui-Gon's Script Shack
Thread Tools Display Modes
Post a new thread. Add a reply to this thread. Indicate all threads in this forum as read. Subscribe to this forum. RSS feed: this forum RSS feed: all forums
Old 01-28-2012, 11:03 AM   #81
Qui-Gon Glenn
Necessary Roughneck
 
Qui-Gon Glenn's Avatar
 
Join Date: May 2007
Location: Thessia
Posts: 1,464
Current Game: ME3MP, Arkham Origins
Folder extraordinaire Helpful! Forum Veteran Veteran Modder 
Ok... It seems to me that there should not be an issue with how you are going about this. I guess I would like to see the code that you created, vs. the vanilla code posted here. If I understand you correctly, you modified these lines:
Code:
string stringGLOB_4 = "g_w_lghtsbr01";   <-- Subbing "pc_lghtsbr_001"?
string stringGLOB_5 = "g_w_lghtsbr03";
string stringGLOB_6 = "g_w_lghtsbr04";
If this is where you performed your substitutions, I would think everything should work just fine. It is simple variable substitution, and the only thing you should have to change are the tags.... as you said.

I am wondering... Did you make this change, and then not use a fresher save where that script had not been called yet? It may be as simple as module memory blocking your new version from firing.

If this is not the simple solution, hopefully one of our more skilled contributors here in the shack can give you a heads up!

EDIT: This may sound stupid. It may be stupid. The filename lengths are different.... 13 chars for "g_w_lghtsbr01" versus 14 chars for "pc_lghtsbr_001". This shouldn't matter, as long as it is less than 16 chars.... but stranger things have been the cause of issue in these games!


Want to play a game of ME3MP?
Qui-Gon_Glenn on the software of which we shall not name.... add me and the enemy shall fall in chunks of crimson salsa

Last edited by Qui-Gon Glenn; 01-28-2012 at 11:09 AM.
Qui-Gon Glenn is offline   you may: quote & reply,
Old 01-28-2012, 11:12 AM   #82
VarsityPuppet
Master of Puppets
 
VarsityPuppet's Avatar
 
Join Date: May 2009
Location: MN
Posts: 1,223
Current Game: Chrono Trigger
Contest winner - Modding Forum Veteran Veteran Modder Helpful! 
Might want to initialize the variable inside of void sub1(). You can declare it up there, but give it the value in the method.

Show spoiler


I hope that helps.... sometimes there's not a good reason for why some of this stuff happens. It's not a very solid system I guess.

and interesting enough, that HK factory code was before I had taken any programming class, so I guess that deduction would make sense, QGG......

Filename/Tag length might do it too though.. yeah that's probably it.


Last edited by VarsityPuppet; 01-28-2012 at 11:17 AM.
VarsityPuppet is offline   you may: quote & reply,
Old 01-28-2012, 11:20 AM   #83
Qui-Don Jorn
Junior Member
 
Qui-Don Jorn's Avatar
 
Join Date: Apr 2010
Location: The Fleet, where are you?
Posts: 435
Current Game: The Old Republic
Helpful! 
Quote:
I am wondering... Did you make this change, and then not use a fresher save where that script had not been called yet? It may be as simple as module memory blocking your new version from firing.
I'm 99% sure I tried it again from a save back at Davik's.
1% of me isn't sure cause my short term memory is completely gone.


Quote:
EDIT: This may sound stupid. It may be stupid. The filename lengths are different.... 13 chars for "g_w_lghtsbr01" versus 14 chars for "pc_lghtsbr_001". This shouldn't matter, as long as it is less than 16 chars.... but stranger things have been the cause of issue in these games
No, not stupid at al Glenn. But already thought of that and changed the tags of my uti's to p_c_lghtsbr01/02/03 and reedited the 2da to match..recompiled the script and the module and started again at Davik's. (I think)...still no dice...even put my saber and crystal uti's in the module file with it..
hold on..new post.
Qui-Don Jorn is offline   you may: quote & reply,
Old 01-28-2012, 11:29 AM   #84
Qui-Don Jorn
Junior Member
 
Qui-Don Jorn's Avatar
 
Join Date: Apr 2010
Location: The Fleet, where are you?
Posts: 435
Current Game: The Old Republic
Helpful! 
Quote:
Might want to initialize the variable inside of void sub1(). You can declare it up there, but give it the value in the method
Kay, not sure what you mean, VP.
void sub1()? you mean object sub1()?

so you mean declare "pc_lghtsbr_xxx" in object sub1()..? like replace object3?

uugh. sorry confused...
what would it actually look like VP?

Oh and yes, QGG, I just subbed the g_w_lghtsbr tags for pc_lghtsbr_xxx, but maybe I should try it again with exactly 13 character tags...I always thought they just needed to be under 16..
Qui-Don Jorn is offline   you may: quote & reply,
Old 01-28-2012, 11:40 AM   #85
VarsityPuppet
Master of Puppets
 
VarsityPuppet's Avatar
 
Join Date: May 2009
Location: MN
Posts: 1,223
Current Game: Chrono Trigger
Contest winner - Modding Forum Veteran Veteran Modder Helpful! 
Concerning this section of code:

Show spoiler


make these changes:

Show spoiler


I don't know if it will help, but it worked on my HK factory code.

VarsityPuppet is offline   you may: quote & reply,
Old 01-28-2012, 11:53 AM   #86
Qui-Don Jorn
Junior Member
 
Qui-Don Jorn's Avatar
 
Join Date: Apr 2010
Location: The Fleet, where are you?
Posts: 435
Current Game: The Old Republic
Helpful! 
Quote:
Originally Posted by VarsityPuppet View Post
Concerning this section of code:

Show spoiler


make these changes:

Show spoiler


I don't know if it will help, but it worked on my HK factory code.
ok i see. and this wouldn't mess with the variable list up top?

then just replace default saber tags with mine in object sub1() ?
Qui-Don Jorn is offline   you may: quote & reply,
Old 01-28-2012, 11:58 AM   #87
Qui-Gon Glenn
Necessary Roughneck
 
Qui-Gon Glenn's Avatar
 
Join Date: May 2007
Location: Thessia
Posts: 1,464
Current Game: ME3MP, Arkham Origins
Folder extraordinaire Helpful! Forum Veteran Veteran Modder 
Quote:
Originally Posted by VarsityPuppet View Post
and interesting enough, that HK factory code was before I had taken any programming class, so I guess that deduction would make sense, QGG......
Oops... I did not know that those were two different versions of your own code I was not meaning a dis! As it is though, the difference between the code samples obviously shows a much deeper understanding of algorithm in the latter - which does make sense, as you have been working your tail off

@KDJ: yeah, initializing the value of the variable inside of that subroutine may do the trick. It shouldn't be that way - there is nothing invalid in trying to go about things the same way the original version did, and it would actually seem to be the best way to go about it. However, this is a case of us giving the OG programmers too much credit - their stuff breaks just as often, if not more often, than our community-made code does.


Want to play a game of ME3MP?
Qui-Gon_Glenn on the software of which we shall not name.... add me and the enemy shall fall in chunks of crimson salsa
Qui-Gon Glenn is offline   you may: quote & reply,
Old 01-28-2012, 03:14 PM   #88
VarsityPuppet
Master of Puppets
 
VarsityPuppet's Avatar
 
Join Date: May 2009
Location: MN
Posts: 1,223
Current Game: Chrono Trigger
Contest winner - Modding Forum Veteran Veteran Modder Helpful! 
Quote:
Originally Posted by Qui-Gon Glenn View Post
Oops... I did not know that those were two different versions of your own code I was not meaning a dis! As it is though, the difference between the code samples obviously shows a much deeper understanding of algorithm in the latter - which does make sense, as you have been working your tail off
Well, it's not like the original code is assembled the greatest fashion... Seriously, talking about endless if and else statements when a simple switch/case would be so much more efficient!

Quote:
yeah, initializing the value of the variable inside of that subroutine may do the trick. It shouldn't be that way - there is nothing invalid in trying to go about things the same way the original version did, and it would actually seem to be the best way to go about it. However, this is a case of us giving the OG programmers too much credit - their stuff breaks just as often, if not more often, than our community-made code does.
A side effect of the engine just not handling the scripts very well. I have had scenarios where the declaration of the object makes all the difference, and while statements simply don't run, despite the correct programming.

VarsityPuppet is offline   you may: quote & reply,
Old 01-28-2012, 03:30 PM   #89
Qui-Gon Glenn
Necessary Roughneck
 
Qui-Gon Glenn's Avatar
 
Join Date: May 2007
Location: Thessia
Posts: 1,464
Current Game: ME3MP, Arkham Origins
Folder extraordinaire Helpful! Forum Veteran Veteran Modder 
Quote:
Originally Posted by VarsityPuppet View Post
A side effect of the engine just not handling the scripts very well. I have had scenarios where the declaration of the object makes all the difference, and while statements simply don't run, despite the correct programming.
The last part of this bugs me.... You are saying that in many cases, while/do loops have failed to run/function properly, despite as you say correct programming and successful compilation?

That would explain some issues I have had....

I agree wholeheartedly on the superior structure of a case/switch over the endless nested if statements... And then I remember JCarter426 a while back stating that he feels the switch gets ignored by the engine fairly often.

This all comes back to the first sentence of your quote.... How sad but true.

Nevertheless, we plow on!

***

@JCarter426: Just wanted to let you know that, despite how confusing I was being with my script issue in the j7 mod, you did illuminate one obvious mistake I was making! I was trying to spawn the container in the wrong module... which may have caused other issues as well. I am going to revisit it today, and I will return with some update. It is going to be a test case for the case/switch, as I am using it to put class-specific loot into the new container.

***

@QDJ- If you got it working, let us know! Otherwise, perhaps post the code you have that is compiling yet still failing? Another set of eyes can be priceless


Want to play a game of ME3MP?
Qui-Gon_Glenn on the software of which we shall not name.... add me and the enemy shall fall in chunks of crimson salsa
Qui-Gon Glenn is offline   you may: quote & reply,
Old 01-28-2012, 03:47 PM   #90
VarsityPuppet
Master of Puppets
 
VarsityPuppet's Avatar
 
Join Date: May 2009
Location: MN
Posts: 1,223
Current Game: Chrono Trigger
Contest winner - Modding Forum Veteran Veteran Modder Helpful! 
Sad, but true. Actually, the while statements would work, but they would stop prematurely without any particular reason. When I divided the while statement up into separate segments though, it seemed to work, and that really threw me off :/ because it shouldn't make a difference really.

Interesting observation from JCarter, considering the switch statement always works for me. In fact, it works so much better than if/else statements that all of the MVI modules use an onEnter script using a global in a switch statement. I was getting some weird results with if/else such as some statements would be completely overlooked despite the correct syntax.

VarsityPuppet is offline   you may: quote & reply,
Old 01-29-2012, 02:46 AM   #91
JCarter426
Senior Member
 
JCarter426's Avatar
 
Join Date: Feb 2008
Location: Look to your left.
Posts: 1,628
For the record, I prefer switches as well - I almost never write a script without them. But it's not that they're ignored, exactly... it's more like what VarsityPuppet said - how you declare the objects matters even when it shouldn't (or it seems like it shouldn't, anyway). When I declare objects inside a case, after spawning them in another case, sometimes the game just doesn't recognize them. Sometimes I've switched to ifs and that worked, although I've had other problems with ifs. Sometimes I've decided to just not declare a variable and used GetObjectByTag over and over, and that worked. Sometimes I've split it into two different scripts, both with their own switches, and that worked. I <3 subroutines too, by the way. Sometimes I've used a subroutine and that worked!


JCarter426 is offline   you may: quote & reply,
Old 01-29-2012, 12:05 PM   #92
VarsityPuppet
Master of Puppets
 
VarsityPuppet's Avatar
 
Join Date: May 2009
Location: MN
Posts: 1,223
Current Game: Chrono Trigger
Contest winner - Modding Forum Veteran Veteran Modder Helpful! 
It can be tedious, but if you declare your variables outside the switch, then initialize/assign values in the switch statement, it oftentimes works waaay better, if not all the time.

If yoou're using some of the same variables in subroutines, I've declared varialbes outside of void main and it worked, although it didn't seem to want to work with integers..

VarsityPuppet is offline   you may: quote & reply,
Old 01-30-2012, 04:04 AM   #93
JCarter426
Senior Member
 
JCarter426's Avatar
 
Join Date: Feb 2008
Location: Look to your left.
Posts: 1,628
Yeah, I've done that too (and that worked ) but sometimes circumstances just warrant a specific way, a way which by all means should work, but doesn't.


JCarter426 is offline   you may: quote & reply,
Old 01-30-2012, 02:58 PM   #94
Qui-Don Jorn
Junior Member
 
Qui-Don Jorn's Avatar
 
Join Date: Apr 2010
Location: The Fleet, where are you?
Posts: 435
Current Game: The Old Republic
Helpful! 
Ok, for this K1script I was working on (not this week) I did actually get it functioning(sort of), but in the worst possible way.

What I eventually ended up doing was making a new sub, and just bypassed it's int_glob and stringGLOB list altogether. So, really I let it do what it was going to do with creating the default sabers. then in my object sub2(), I created my sabers and equipped them just like they had. Except mine went straight for the Global Number "DAN_PATH_STATE" check, and if 1 = create blue, 2 = create yellow, 3 = create green. Then in the void main () I destroyed the default saber and said ShowUpgradeScreen with my new object...but that was the only part that didn't work.

I think I could get it to work if I just re-wrote their object sub1() like I wrote my object sub2()..
Will post when (if) I get it working..


Ok, Im back...So what I'm proposing would look like this..

Code:
// Globals
	int intGLOB_1 = 1;
	int intGLOB_2 = 2;
	int intGLOB_3 = 3;
	int intGLOB_4 = 4;
	int intGLOB_5 = 5;
	int intGLOB_6 = 6;
	int intGLOB_7 = 3;
	int intGLOB_8 = 4;
	int intGLOB_9 = 5;
	int intGLOB_10 = 6;
	int intGLOB_11 = 7;
	int intGLOB_12 = 1;
	int intGLOB_13 = 2;
	int intGLOB_14 = 3;
	int intGLOB_15 = 4;
	int intGLOB_16 = 5;
	int intGLOB_17 = 6;
	int intGLOB_18 = 7;
	int intGLOB_19 = 8;
	int intGLOB_20 = 9;
	int intGLOB_21 = 10;
	int intGLOB_22 = 11;
	int intGLOB_23 = 12;
	int intGLOB_24 = 13;
	int intGLOB_25 = 14;
	int intGLOB_26 = 15;
	int intGLOB_27 = 16;
	int intGLOB_28 = 17;
	int intGLOB_29 = 18;
	int intGLOB_30 = 19;
	int intGLOB_31 = 20;
	int intGLOB_32 = 21;
	int intGLOB_33 = 22;
	int intGLOB_34 = 23;
	int intGLOB_35 = 24;
	int intGLOB_36 = 25;
	int intGLOB_37 = 26;
	int intGLOB_38 = 27;
	int intGLOB_39 = 28;
	int intGLOB_40 = 29;
	int intGLOB_41 = 30;
	int intGLOB_42 = 59;
	int intGLOB_43 = 0;
	int intGLOB_44 = 1;
	int intGLOB_45 = 2;
	int intGLOB_46 = 29;
	int intGLOB_47 = 30;
	int intGLOB_48 = 34;
	int intGLOB_49 = 35;
	int intGLOB_50 = 36;
	int intGLOB_51 = 37;
	int intGLOB_52 = 38;
	int intGLOB_53 = 39;
	int intGLOB_54 = 41;
	int intGLOB_55 = 42;
	int intGLOB_56 = 46;
	int intGLOB_57 = 47;
	int intGLOB_58 = 15;
	int intGLOB_59 = 10;
	int intGLOB_60 = 5;
	int intGLOB_61 = 2;
	int intGLOB_62;
	int intGLOB_63;
	int intGLOB_64;
	object objectGLOB_1;
	int intGLOB_65;
	int intGLOB_66;
	int intGLOB_67;
	int intGLOB_68;
	int intGLOB_69;
	int intGLOB_70;
	int intGLOB_71 = 1;
	int intGLOB_72 = 2;
	int intGLOB_73 = 3;
	int intGLOB_74 = 20;
	int intGLOB_75 = 21;
	int intGLOB_76 = 22;
	int intGLOB_77 = 23;
	int intGLOB_78 = 24;
	int intGLOB_79 = 25;
	int intGLOB_80 = 26;
	int intGLOB_81 = 27;
	int intGLOB_82 = 28;
	int intGLOB_83 = 31;
	int intGLOB_84 = 32;
	int intGLOB_85 = 33;
	int intGLOB_86 = 40;
	int intGLOB_87 = 43;
	int intGLOB_88 = 44;
	int intGLOB_89 = 45;
	int intGLOB_90 = 48;
	int intGLOB_91 = 49;
	int intGLOB_92 = 50;
	int intGLOB_93 = 51;
	int intGLOB_94 = 52;
	int intGLOB_95 = 53;
	int intGLOB_96 = 54;
	int intGLOB_97 = 55;
	int intGLOB_98 = 56;
	int intGLOB_99 = 57;
	int intGLOB_100 = 58;
	int intGLOB_101 = 60;
	int intGLOB_102 = 61;
	int intGLOB_103 = 62;
	int intGLOB_104 = 63;
	int intGLOB_105 = 64;
	int intGLOB_106 = 65;
	int intGLOB_107 = 66;
	int intGLOB_108 = 67;
	int intGLOB_109 = 68;
	int intGLOB_110 = 69;
	int intGLOB_111 = 70;
	int intGLOB_112 = 71;
	int intGLOB_113 = 72;
	int intGLOB_114 = 1;
	int intGLOB_115 = 2;
	int intGLOB_116 = 3;
	int intGLOB_117 = 4;
	int intGLOB_118 = 0;
	int intGLOB_119 = 1;
	int intGLOB_120 = 2;
	int intGLOB_121 = 3;
	int intGLOB_122 = 4;
	int intGLOB_123 = 5;
	int intGLOB_124 = 6;
	int intGLOB_125 = 7;
	int intGLOB_126 = 8;
	int intGLOB_127 = 9;
	int intGLOB_128 = 10;
	int intGLOB_129 = 11;
	int intGLOB_130 = 12;
	int intGLOB_131 = 13;
	int intGLOB_132 = 14;
	int intGLOB_133 = 15;
	int intGLOB_134 = 16;
	int intGLOB_135 = 17;
	int intGLOB_136 = 18;
	int intGLOB_137 = 19;
	int intGLOB_138 = 1100;
	int intGLOB_139 = (-6);
	int intGLOB_140 = (-5);
	int intGLOB_141 = (-4);
	int intGLOB_142 = (-2);
	int intGLOB_143 = (-1);
	int intGLOB_144 = 0;
	int intGLOB_145 = 4;
	int intGLOB_146 = 1;
	int intGLOB_147 = 7;
	int intGLOB_148 = 1;
	int intGLOB_149 = 2;
	int intGLOB_150 = 3;
	int intGLOB_151 = 1;
	int intGLOB_152 = 2;
	int intGLOB_153 = 3;
	int intGLOB_154 = 4;
	int intGLOB_155 = 5;
	int intGLOB_156 = 6;
	string stringGLOB_1 = "bastila";
	string stringGLOB_2 = "carth";
	string stringGLOB_3 = "dan13_WP_council";
	string stringGLOB_4 = "g_w_lghtsbr01";
	string stringGLOB_5 = "g_w_lghtsbr03"; 
	string stringGLOB_6 = "g_w_lghtsbr04";
             string stringGLOB_7 = "dan_wanderhound";

// Prototypes
object sub1();

object sub1() {
	object oPC = GetFirstPC();
	object oSbr;
	object object4 = GetItemPossessedBy(GetFirstPC(), "dan13_plotcrys");
	SetPlotFlag(object4, 0);
	DestroyObject(object4, 0.0, 0, 0.0);
	
	if (GetGlobalNumber("DAN_PATH_STATE") == 1) {
		
			oSbr = CreateItemOnObject("pc_lghtsbr_001", oPC, 1);
		}
		else {
			if (GetGlobalNumber("DAN_PATH_STATE") == 2) {
				oSbr = CreateItemOnObject("pc_lghtsbr_002", oPC, 1);
			}
			else {
				if (GetGlobalNumber("DAN_PATH_STATE") == 3) {
					oSbr = CreateItemOnObject(pc_lghtsbr_003", oPC, 1);
				}
			}
		}
	}
	if (GetIsObjectValid(oSbr)) {
		DelayCommand(0.1, AssignCommand(oPC, ActionEquipItem(oSbr, 4, 0)));
	}
	return oSbr;
}

void main() {
	object object1 = sub1();
	ShowUpgradeScreen(object1);
}
So - bypass the intGLOB and stringGLOBs altogether...then I wouldn't need the object sub2() I mentioned before. Because that is my object sub2(), just with a DestroyObject(object1); in the main function.
Whaddaya think?
-QDJ

Last edited by Qui-Don Jorn; 01-30-2012 at 03:28 PM.
Qui-Don Jorn is offline   you may: quote & reply,
Old 01-31-2012, 05:37 AM   #95
JCarter426
Senior Member
 
JCarter426's Avatar
 
Join Date: Feb 2008
Location: Look to your left.
Posts: 1,628
Not sure if this matters, but if you're not going to use them, you should remove them - you've left the declarations in but didn't use them, and NWScript doesn't really like that.

Also, I don't think you need to declare the subroutine before using it. I never do, anyway.


JCarter426 is offline   you may: quote & reply,
Old 01-31-2012, 12:08 PM   #96
VarsityPuppet
Master of Puppets
 
VarsityPuppet's Avatar
 
Join Date: May 2009
Location: MN
Posts: 1,223
Current Game: Chrono Trigger
Contest winner - Modding Forum Veteran Veteran Modder Helpful! 
You only have to declare sub1() if you're putting the code after the main function. Otherwise, you can declare and initialize it in one statement.

aka:
//No need for writing sub1();

void sub1(){
[insert code]
}

void main{
[insert code]
}

VarsityPuppet is offline   you may: quote & reply,
Old 01-31-2012, 01:53 PM   #97
darth-ackbar
Rookie
 
darth-ackbar's Avatar
 
Join Date: Dec 2011
Location: Death Star
Posts: 158
Current Game: The Search For Revan
hi, does anyone know if it is possible to modify functions, for example "ShowPartySelectionGUI()"?

I had a look at the scripts, source.bif and i cant find anything I get the feeling that this might be quite difficult


Search For Revan Website: www.kotorsearchforrevan.wetpaint.com

Search For Revan LucasForums Thread


<a href=http://www.kotorsearchforrevan.wetpaint.com target=_blank>http://www.kotorsearchforrevan.wetpaint.com</a>
darth-ackbar is offline   you may: quote & reply,
Old 01-31-2012, 02:31 PM   #98
Qui-Gon Glenn
Necessary Roughneck
 
Qui-Gon Glenn's Avatar
 
Join Date: May 2007
Location: Thessia
Posts: 1,464
Current Game: ME3MP, Arkham Origins
Folder extraordinaire Helpful! Forum Veteran Veteran Modder 
Code:
// 712: ShowPartySelectionGUI
// Brings up the party selection GUI for the player to
// select the members of the party from
// if exit script is specified, will be executed when
// the GUI is exited
void ShowPartySelectionGUI(string sExitScript = "", int nForceNPC1 = -1, int nForceNPC2 = -1);
Hardcoded.


Want to play a game of ME3MP?
Qui-Gon_Glenn on the software of which we shall not name.... add me and the enemy shall fall in chunks of crimson salsa
Qui-Gon Glenn is offline   you may: quote & reply,
Old 02-01-2012, 03:24 PM   #99
Qui-Don Jorn
Junior Member
 
Qui-Don Jorn's Avatar
 
Join Date: Apr 2010
Location: The Fleet, where are you?
Posts: 435
Current Game: The Old Republic
Helpful! 
ok..this works but still, I need to remove my sub2 and just insert my new stringGLOB tags...i cut top off for brevity.

Code:
intGLOB_151 = 1;
	int intGLOB_152 = 2;
	int intGLOB_153 = 3;
	int intGLOB_154 = 4;
	int intGLOB_155 = 5;
	int intGLOB_156 = 6;
	string stringGLOB_1 = "bastila";
	string stringGLOB_2 = "carth";
	string stringGLOB_3 = "dan13_WP_council";
	string stringGLOB_4 = "g_w_lghtsbr01";
	string stringGLOB_5 = "g_w_lghtsbr03";
	string stringGLOB_6 = "g_w_lghtsbr04";
	string stringGLOB_7 = "dan_wanderhound";
	string stringGLOB_8 = "pc_lghtsbr_001";
	string stringGLOB_9 = "pc_lghtsbr_002";
	string stringGLOB_10 = "pc_lghtsbr_003";

// Prototypes
object sub2();
object sub1();

object sub2() {
	object oPC = GetFirstPC();
	object object5;	
	int nGlobal = GetGlobalNumber("DAN_PATH_STATE");
	if ((nGlobal > 0)) {
		if ((nGlobal == intGLOB_148)) {
			object5 = CreateItemOnObject(stringGLOB_8, oPC, 1);
		}
		else {
			if ((nGlobal == intGLOB_149)) {
				object5 = CreateItemOnObject(stringGLOB_10, oPC, 1);
			}
			else {
				if ((nGlobal == intGLOB_150)) {
					object5 = CreateItemOnObject(stringGLOB_9, oPC, 1);
				}
			}
		}
	}
	if (GetIsObjectValid(object5)) {
		DelayCommand(0.3, AssignCommand(oPC, ActionEquipItem(object5, 4, 0)));
	}
	return object5;
}

object sub1() {
	object oPC = GetFirstPC();
	object object3;
	object object4 = GetItemPossessedBy(GetFirstPC(), "dan13_plotcrys");
	SetPlotFlag(object4, 0);
	DestroyObject(object4, 0.0, 0, 0.0);
	int nGlobal = GetGlobalNumber("DAN_PATH_STATE");
	if ((nGlobal > 0)) {
		if ((nGlobal == intGLOB_148)) {
			object3 = CreateItemOnObject(stringGLOB_4, oPC, 1);
		}
		else {
			if ((nGlobal == intGLOB_149)) {
				object3 = CreateItemOnObject(stringGLOB_6, oPC, 1);
			}
			else {
				if ((nGlobal == intGLOB_150)) {
					object3 = CreateItemOnObject(stringGLOB_5, oPC, 1);
				}
			}
		}
	}
	if (GetIsObjectValid(object3)) {
		DelayCommand(0.1, AssignCommand(oPC, ActionEquipItem(object3, 4, 0)));
	}
	return object3;
}

void main() {
	object object1 = sub1();
	DestroyObject(object1, 0.0, 0, 0.0);  
	object object2 = sub2();
	ShowUpgradeScreen(object2);  	
}
When I originally did it I only had 3 closes at the end of the if/else statements in sub2, so the pc wasn't equipping the saber. So I fixed that but haven't re-tested.
Qui-Don Jorn is offline   you may: quote & reply,
Old 02-01-2012, 04:55 PM   #100
VarsityPuppet
Master of Puppets
 
VarsityPuppet's Avatar
 
Join Date: May 2009
Location: MN
Posts: 1,223
Current Game: Chrono Trigger
Contest winner - Modding Forum Veteran Veteran Modder Helpful! 
Code:
void main() {
	object object1 = sub1();
	DestroyObject(object1, 0.0, 0, 0.0);  
//You may delete the code in red
	object object2 = sub2();
	ShowUpgradeScreen(object2);  	
}
Seems like it would work. Might as well delete the code I highlighted though. It's garbage now, and it might mess with the new code you put in.

VarsityPuppet is offline   you may: quote & reply,
Old 02-01-2012, 05:24 PM   #101
Qui-Don Jorn
Junior Member
 
Qui-Don Jorn's Avatar
 
Join Date: Apr 2010
Location: The Fleet, where are you?
Posts: 435
Current Game: The Old Republic
Helpful! 
ok, will do. I'll test it tonite.
Qui-Don Jorn is offline   you may: quote & reply,
Old 02-03-2012, 11:03 AM   #102
JCarter426
Senior Member
 
JCarter426's Avatar
 
Join Date: Feb 2008
Location: Look to your left.
Posts: 1,628
You can do the same with object 2. Your subroutine already returns an object, so it's redundant.


JCarter426 is offline   you may: quote & reply,
Old 03-02-2012, 12:09 PM   #103
UltimateHK47
Forumite
 
UltimateHK47's Avatar
 
Join Date: Nov 2011
Location: In a Galaxy, far far away...
Posts: 500
Current Game: Kotor 1
void main () {
if(GetModuleName == "ebo_m12aa") {
CreateObject(OBJECT_TYPE_PLACEABLE, "object resref", location vector, FALSE);
Location(x, y, z), xorientation, yorientation
}
}

coordinates are 53.23, 60.37 and 1.80 (x,y,z in order)

I kind user gave me this script, and I was wondering if this would work if I wanted to:

See if I was on the Ebon Hawk and if yes spawn the tur_arc (res ref)
At the space specified by the coordinates. Could you help?What needs to be done?


http://www.lucasforums.com/showthrea...12#post2807812
The Turret Arcade 1.2 ^^


USED TO BE KNOWN AS DARTH JANGO/WEASLEY
UltimateHK47 is offline   you may: quote & reply,
Old 03-02-2012, 01:36 PM   #104
darth-ackbar
Rookie
 
darth-ackbar's Avatar
 
Join Date: Dec 2011
Location: Death Star
Posts: 158
Current Game: The Search For Revan
just to clarify, the script I gave DJW, with the values he's just posted, would be:

Code:
void main () {
  if(GetModuleName == "ebo_m12aa") {
    CreateObject(OBJECT_TYPE_PLACEABLE, "tur_arc", Location(53.23, 60.37, 1.80), xorientation, yorientation, FALSE);
  }
}
I know for a fact that it's wrong, but I wasn't sure how to make it right. Sorry about that DJW


Search For Revan Website: www.kotorsearchforrevan.wetpaint.com

Search For Revan LucasForums Thread


<a href=http://www.kotorsearchforrevan.wetpaint.com target=_blank>http://www.kotorsearchforrevan.wetpaint.com</a>
darth-ackbar is offline   you may: quote & reply,
Old 03-02-2012, 03:28 PM   #105
UltimateHK47
Forumite
 
UltimateHK47's Avatar
 
Join Date: Nov 2011
Location: In a Galaxy, far far away...
Posts: 500
Current Game: Kotor 1
More then I could do, thanks.


http://www.lucasforums.com/showthrea...12#post2807812
The Turret Arcade 1.2 ^^


USED TO BE KNOWN AS DARTH JANGO/WEASLEY
UltimateHK47 is offline   you may: quote & reply,
Old 03-02-2012, 06:59 PM   #106
Qui-Don Jorn
Junior Member
 
Qui-Don Jorn's Avatar
 
Join Date: Apr 2010
Location: The Fleet, where are you?
Posts: 435
Current Game: The Old Republic
Helpful! 
maybe something more like...

Code:
void main() {

if ((GetModuleName() == "ebo_m12aa")) {
    CreateObject(64, "tur_arc", Location(Vector(53.23, 60.37, 1.80), xx.x, FALSE));
    }
}


...or somesuch..
Qui-Don Jorn is offline   you may: quote & reply,
Old 03-03-2012, 04:04 AM   #107
darth-ackbar
Rookie
 
darth-ackbar's Avatar
 
Join Date: Dec 2011
Location: Death Star
Posts: 158
Current Game: The Search For Revan
I think you've pretty much got it there Kuai-Donn, maybe:

Code:
void main() {

if ((GetModuleName() == "ebo_m12aa")) {
    CreateObject(64, "tur_arc", Location(Vector(53.23, 60.37, 1.80), xx.x, yy.y) FALSE);
    }
}
Id give that a go DJW, see what happens.

Also, if your doing this for K1, I seem to remember that the whereami cheat doesn't give orientation values. I'm not sure how you would get them but for now just put 0 in each, sort it out later


Search For Revan Website: www.kotorsearchforrevan.wetpaint.com

Search For Revan LucasForums Thread


<a href=http://www.kotorsearchforrevan.wetpaint.com target=_blank>http://www.kotorsearchforrevan.wetpaint.com</a>
darth-ackbar is offline   you may: quote & reply,
Old 03-03-2012, 07:15 AM   #108
UltimateHK47
Forumite
 
UltimateHK47's Avatar
 
Join Date: Nov 2011
Location: In a Galaxy, far far away...
Posts: 500
Current Game: Kotor 1
Cheers. Ill test it later


http://www.lucasforums.com/showthrea...12#post2807812
The Turret Arcade 1.2 ^^


USED TO BE KNOWN AS DARTH JANGO/WEASLEY
UltimateHK47 is offline   you may: quote & reply,
Old 03-03-2012, 10:50 AM   #109
UltimateHK47
Forumite
 
UltimateHK47's Avatar
 
Join Date: Nov 2011
Location: In a Galaxy, far far away...
Posts: 500
Current Game: Kotor 1
Erm it sais syntax error at "False" when trying to compile
void main() {
if ((GetModuleName() == "ebo_m12aa")) {
CreateObject(64, "tur_arc", Location(Vector(53.23, 60.37, 1.80), 0.0, 0.0) FALSE);
}
}


http://www.lucasforums.com/showthrea...12#post2807812
The Turret Arcade 1.2 ^^


USED TO BE KNOWN AS DARTH JANGO/WEASLEY
UltimateHK47 is offline   you may: quote & reply,
Old 03-03-2012, 02:01 PM   #110
darth-ackbar
Rookie
 
darth-ackbar's Avatar
 
Join Date: Dec 2011
Location: Death Star
Posts: 158
Current Game: The Search For Revan
You need to put a comma between the location and FALSE. So it would be:

Code:
CreateObject(64, "tur_arc", Location(Vector(x, y, z), x, y), FALSE);


Search For Revan Website: www.kotorsearchforrevan.wetpaint.com

Search For Revan LucasForums Thread


<a href=http://www.kotorsearchforrevan.wetpaint.com target=_blank>http://www.kotorsearchforrevan.wetpaint.com</a>
darth-ackbar is offline   you may: quote & reply,
Old 03-03-2012, 03:38 PM   #111
UltimateHK47
Forumite
 
UltimateHK47's Avatar
 
Join Date: Nov 2011
Location: In a Galaxy, far far away...
Posts: 500
Current Game: Kotor 1
void main() {
if ((GetModuleName() == "ebo_m12aa")) {
CreateObject(64, "tur_arc", Location(Vector(53.23, 60.37, 1.80), 0.0, 0.0), FALSE);
}
}

It now sais too many arguments specified in cell "location"
And required argument missing in cell "CreateObject"
What do I do?
(Do I need OBJECT_TYPE_PLACEABLE inserted somewhere?


http://www.lucasforums.com/showthrea...12#post2807812
The Turret Arcade 1.2 ^^


USED TO BE KNOWN AS DARTH JANGO/WEASLEY
UltimateHK47 is offline   you may: quote & reply,
Old 03-03-2012, 06:20 PM   #112
Hassat Hunter
Forumite
 
Join Date: Jan 2010
Posts: 535
First of all, not sure why there are 2 ( at GetModuleName... reason? 1 should suffice.

Your current issue is due an incorrect ) icon. The one after 0.0 should go beyond 1.80 too (so 2 there). Does it work now?
Hassat Hunter is offline   you may: quote & reply,
Old 03-03-2012, 06:25 PM   #113
Qui-Don Jorn
Junior Member
 
Qui-Don Jorn's Avatar
 
Join Date: Apr 2010
Location: The Fleet, where are you?
Posts: 435
Current Game: The Old Republic
Helpful! 
Quote:
Originally Posted by DarthJango/Weasley View Post
void main() {
if ((GetModuleName() == "ebo_m12aa")) {
CreateObject(64, "tur_arc", Location(Vector(53.23, 60.37, 1.80), 0.0, 0.0), FALSE);
}
}

It now sais too many arguments specified in cell "location"
And required argument missing in cell "CreateObject"
What do I do?
(Do I need OBJECT_TYPE_PLACEABLE inserted somewhere?
No, you just need to close twice after FALSE and not the vector..
oh wait...reading that wrong.. (edit 1 I dont know I bow out..)

Edit again)...no I stand by that actually...and you dont even need the FALSE anyway. tell me if Im wrong.

Hassat, the reason I put two (( in now is because when I complied scripts with one, then decomplied the same script, it was putting two there anyway, and it never gave me any problems..

Last edited by Qui-Don Jorn; 03-03-2012 at 06:32 PM.
Qui-Don Jorn is offline   you may: quote & reply,
Old 03-04-2012, 08:12 AM   #114
UltimateHK47
Forumite
 
UltimateHK47's Avatar
 
Join Date: Nov 2011
Location: In a Galaxy, far far away...
Posts: 500
Current Game: Kotor 1
I'm a little embaresed but for some reason (maybe because I've just woken up) and I'm getting a little confused so could anyone go through the changes I need to do. Or even better, and example script. But thanks for helping me so far,

-DJW

EDIT: It sais tur_arc1.nss(2) syntax error at ")"
With this script. Am I on the right tracks?
void main() {
if (GetModuleName() == "ebo_m12aa")) {
CreateObject(64, "tur_arc", Location(Vector(53.23, 60.37, 1.80, 0.0, 0.0), FALSE));
}
}


http://www.lucasforums.com/showthrea...12#post2807812
The Turret Arcade 1.2 ^^


USED TO BE KNOWN AS DARTH JANGO/WEASLEY
UltimateHK47 is offline   you may: quote & reply,
Old 03-04-2012, 08:23 AM   #115
Qui-Don Jorn
Junior Member
 
Qui-Don Jorn's Avatar
 
Join Date: Apr 2010
Location: The Fleet, where are you?
Posts: 435
Current Game: The Old Republic
Helpful! 
try this..

void main() {
if (GetModuleName() == "ebo_m12aa") {
CreateObject(64, "tur_arc", Location(Vector(53.23, 60.37, 1.80), 0.00, 0.00));
}
}

see if that works..
Qui-Don Jorn is offline   you may: quote & reply,
Old 03-04-2012, 08:55 AM   #116
UltimateHK47
Forumite
 
UltimateHK47's Avatar
 
Join Date: Nov 2011
Location: In a Galaxy, far far away...
Posts: 500
Current Game: Kotor 1
Quote:
Originally Posted by Kuai-Donn Jorn View Post
try this..

void main() {
if (GetModuleName() == "ebo_m12aa") {
CreateObject(64, "tur_arc", Location(Vector(53.23, 60.37, 1.80), 0.00, 0.00));
}
}

see if that works..
The script sais
Required argument missing in call to "CreateObject"
and
To many arguments specified in call to "Location"
What should I do?

Thanks for the help so far
-DJW


http://www.lucasforums.com/showthrea...12#post2807812
The Turret Arcade 1.2 ^^


USED TO BE KNOWN AS DARTH JANGO/WEASLEY
UltimateHK47 is offline   you may: quote & reply,
Old 03-04-2012, 09:04 AM   #117
Qui-Don Jorn
Junior Member
 
Qui-Don Jorn's Avatar
 
Join Date: Apr 2010
Location: The Fleet, where are you?
Posts: 435
Current Game: The Old Republic
Helpful! 
Code:
void main() { 
  if (GetModuleName() == "ebo_m12aa") { 
  CreateObject(64, "tur_arc", Location(Vector(53.23, 60.37, 1.80), 0.0));
  } 
}
This compiled the *first time* I tried it.
It should work, my mistake was putting x and y after the vector
Qui-Don Jorn is offline   you may: quote & reply,
Old 03-04-2012, 09:09 AM   #118
UltimateHK47
Forumite
 
UltimateHK47's Avatar
 
Join Date: Nov 2011
Location: In a Galaxy, far far away...
Posts: 500
Current Game: Kotor 1
Quote:
Originally Posted by Kuai-Donn Jorn View Post
Code:
void main() { 
  if (GetModuleName() == "ebo_m12aa") { 
  CreateObject(64, "tur_arc", Location(Vector(53.23, 60.37, 1.80), 0.0));
  } 
}
This compiled the *first time* I tried it.
It should work, my mistake was putting x and y after the vector
Yay it compiled. Thanks so much! You'll be credited. As well as everyone else who helped. Time to test- Ill post how it goes later

Cheers again
-DJW


http://www.lucasforums.com/showthrea...12#post2807812
The Turret Arcade 1.2 ^^


USED TO BE KNOWN AS DARTH JANGO/WEASLEY
UltimateHK47 is offline   you may: quote & reply,
Old 03-04-2012, 09:49 AM   #119
darth-ackbar
Rookie
 
darth-ackbar's Avatar
 
Join Date: Dec 2011
Location: Death Star
Posts: 158
Current Game: The Search For Revan
Yeah I was going to post that earlier but I had to go out Well done everybody and I'm looking forward to your mod DJW


Search For Revan Website: www.kotorsearchforrevan.wetpaint.com

Search For Revan LucasForums Thread


<a href=http://www.kotorsearchforrevan.wetpaint.com target=_blank>http://www.kotorsearchforrevan.wetpaint.com</a>
darth-ackbar is offline   you may: quote & reply,
Old 03-04-2012, 11:31 AM   #120
UltimateHK47
Forumite
 
UltimateHK47's Avatar
 
Join Date: Nov 2011
Location: In a Galaxy, far far away...
Posts: 500
Current Game: Kotor 1
Another question, can you set, like for the caretaker, a script which tells the game a line of dialog has already been said, so you can't repeat that particular line. And vice versa, so it sais it hasn't said that line, so it's available.


http://www.lucasforums.com/showthrea...12#post2807812
The Turret Arcade 1.2 ^^


USED TO BE KNOWN AS DARTH JANGO/WEASLEY
UltimateHK47 is offline   you may: quote & reply,
Post a new thread. Add a reply to this thread. Indicate all threads in this forum as read. Subscribe to this forum. RSS feed: this forum RSS feed: all forums
Go Back   LucasForums > Network > Knights of the Old Republic > Editing / Modding > Holowan Laboratories > Qui-Gon's Script Shack

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 10:00 PM.

LFNetwork, LLC ©2002-2011 - All rights reserved.
Powered by vBulletin®
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.