Scripting problem -1 reply

Please wait...

Evil_Jedi

Mapper, Skinner, Noob Scripter

50 XP

20th June 2003

0 Uploads

379 Posts

0 Threads

#1 14 years ago

I made a script, doesn't do much except a problem here is what I have:

autoexec.cfgseta cg_drawcrosshair 1 seta cg_drawradar 1

set "forcepowers" "helpusobi 1;setforcelightning 3;setforcedrain 3; setforcegrip 3;setforcerage 3;setforceheal 3;setforceprotect 3; setforceabsorb 3;setforcepush 3;setforcepull 3;setforcejump 3; setforcespeed 3;setsaberoffense 3;setsaberdefense 3;setsaberthrow 3; setmindtrick 3;setforcesight 3"

bind = "vstr forcepowers"

set "dualsabers" "saber single_5 single_5;sabercolor 1 purple;sabercolor 2 purple"

bind d "vstr dualsabers"

set "staff" "saber dual_1;sabercolor 1 purple;sabercolor 2 purple"

bind f "vstr staff"

set "singlesaber" "saber single_5;sabercolor 1 purple"

bind s "vstr singlesaber"

The force "cheat" only gives me that the cheats are enabled but only like 2 or 3 forcepowers... As for the staff, only one side of it comes out in purple and the other side comes out a random color. Wut's the cmd for that?




Darth Dwarf

No, Reality isn't required

50 XP

23rd May 2004

0 Uploads

96 Posts

0 Threads

#2 14 years ago

nvm i typed and put something in but its wrong i read your sprict wrong sorry.




Evil_Jedi

Mapper, Skinner, Noob Scripter

50 XP

20th June 2003

0 Uploads

379 Posts

0 Threads

#3 14 years ago

What were you suggesting? Oh btw the whole:

set "forcepowers" "helpusobi 1;setforcelightning 3;setforcedrain 3; setforcegrip 3;setforcerage 3;setforceheal 3;setforceprotect 3; setforceabsorb 3;setforcepush 3;setforcepull 3;setforcejump 3; setforcespeed 3;setsaberoffense 3;setsaberdefense 3;setsaberthrow 3; setmindtrick 3;setforcesight 3"

part is all on one line, and it gives no effect whatsoever, but when I put spaces it only does the first line which usually only works if I have like 5 or so on one line.




moberemk

Just a guy who likes to help.

50 XP

1st December 2003

0 Uploads

1,285 Posts

0 Threads

#4 14 years ago

You need to set custom sabercolor 1 and custom sabercolor 2 in your script for the staff.




Evil_Jedi

Mapper, Skinner, Noob Scripter

50 XP

20th June 2003

0 Uploads

379 Posts

0 Threads

#5 14 years ago

But I have that: "sabercolor 1 purple;sabercolor 2 purple"




JaedenRuiner

Crazy Coding SP Guy...

50 XP

27th December 2002

0 Uploads

168 Posts

0 Threads

#6 14 years ago

Evil_Jedi set "forcepowers" "helpusobi 1;setforcelightning 3;setforcedrain 3; setforcegrip 3;setforcerage 3;setforceheal 3;setforceprotect 3; setforceabsorb 3;setforcepush 3;setforcepull 3;setforcejump 3; setforcespeed 3;setsaberoffense 3;setsaberdefense 3;setsaberthrow 3; setmindtrick 3;setforcesight 3" [/quote]

I think this would be easier using "setforceall 3" and voila you have force level 3 on all force powers.

Secondly, if you are worried about the "saber styles" involved with this use the:

setsaberstyle [SS_FAST | SS_MEDIUM | SS_STRONG | SS_TAVION | SS_DESANN] or addsaberstyle [SS_FAST | SS_MEDIUM | SS_STRONG | SS_TAVION | SS_DESANN]

to make sure your saber styles are what you want them to be. example: set forcepowers "helpusobi 1; setforceall 3; setsaberstyle ss_medium; addsaberstyle ss_fast; addsaberstyle ss_strong; helpusobi 0"

[quote=moberemk] You need to set custom sabercolor 1 and custom sabercolor 2 in your script for the staff.

I think what he was talking about was the specific .sab file for your dual saber. It might be written to have two "custom" saber colors, thus your usage of the "sabercolor" won't work. By default, the dual saber automatically uses one color for both blades, unless otherwise declared by the .sab file for the saber.

Anyway, slightly off the topic, you might find the following helpful. if you do decide to use the above code (setforceall) I provided for setting your force powers, I have another little script set here that works very well for manipulating saber styles on top of that. I have noticed that sometimes the setforceall command does not play nice with the saberstyles available to you, and thus, can often glitch the ability to use appropriate saber styles in game. As well, this might also help you look at a more effecient way of manipulating and controling your force powers in game with CFG script files.

Try playing with these, and substitute your own force power controls, such as: "helpusobi 1; setforcelightning 3; helpusobi 0" etc within this menu control, and maybe the cheat will work more efficiently.

Jaeden "Sifo Dyas" al'Raec Ruiner

put all files in(except autoexec.cfg): w:\JKAFolder\GameData\Base\Sabers ---------------- autoexec.cfg ---------------- bind [key] "exec sabers/sabermenu.cfg"

------------------ sabermenu.cfg ------------------ //Initialize Menu // This script is designed to work with JediAcademy, for the use of Programming specific //Saber Style configurations.

exec "sabers/StyleInit.cfg"

bind 1 "exec sabers/def_single.cfg" bind 2 "exec sabers/def_dual.cfg" bind 3 "exec sabers/def_staff.cfg" bind 4 "exec sabers/manual_cfg.cfg" bind 5 "exec sabers/premade_cfg.cfg" bind 0 "exec sabers/weapdefault.cfg"

Echo "^1<=====[ ^3Saber Style Menu ^1]=====>" Echo "^2#1^7.........^2Single ^0| ^2#2^7......^4Dual ^4Sabers ^0| ^2#3^7..^1Staff ^1Saber ^0| Echo "^2#4^7..^5Manual ^5Config ^0| ^2#5^7..^7Premade ^7Configs ^0| ^2#0^7..^6Exit"

-------------- styleinit.cfg -------------- set style_Fast "setsaberstyle SS_FAST; exec sabers/StyleAdd.cfg" set style_Medium "setsaberstyle SS_MEDIUM; exec sabers/StyleAdd.cfg" set style_Strong "setsaberstyle SS_STRONG; exec sabers/StyleAdd.cfg" set style_Tavion "setsaberstyle SS_TAVION; exec sabers/StyleAdd.cfg" set style_Desann "setsaberstyle SS_DESANN; exec sabers/StyleAdd.cfg" set style_Staff "setsaberstyle SS_STAFF; exec sabers/StyleAdd.cfg" set style_Dual "setsaberstyle SS_DUAL; exec sabers/StyleAdd.cfg"

--------------- styleadd.cfg --------------- set style_Fast "addsaberstyle SS_FAST" set style_Medium "addsaberstyle SS_MEDIUM" set style_Strong "addsaberstyle SS_STRONG" set style_Tavion "addsaberstyle SS_TAVION" set style_Desann "addsaberstyle SS_DESANN" set style_Staff "addsaberstyle SS_STAFF" set style_Dual "addsaberstyle SS_DUAL"

----------------- def_single.cfg ----------------- //Initialize Menu // This script is designed to work with JediAcademy, for the use of Programming specific //Saber Style configurations.

Echo "^7Saber ^7Style(s) ^7Activated: ^4Fast^7, ^3Medium^7, ^1Strong^7."

vstr style_Fast vstr style_Medium vstr style_Strong

exec "sabers/weapdefault.cfg"

---------------- def_dual.cfg ---------------- //Initialize Menu // This script is designed to work with JediAcademy, for the use of Programming specific //Saber Style configurations.

Echo "^7Saber ^7Style(s) ^7Activated: ^2Dual ^2Sabers^7."

vstr style_Dual

exec "sabers/weapdefault.cfg"

--------------- def_staff.cfg --------------- //Initialize Menu // This script is designed to work with JediAcademy, for the use of Programming specific //Saber Style configurations.

Echo "^7Saber ^7Style(s) ^7Activated: ^6Staff ^6Saber^7."

vstr style_Staff

exec "sabers/weapdefault.cfg"

------------------- manual_cfg.cfg ------------------- //Initialize Menu // This script is designed to work with JediAcademy, for the use of Programming specific //Saber Style configurations.

bind 1 "vstr style_Fast; exec sabers/manual_cfg.cfg" bind 2 "vstr style_Medium; exec sabers/manual_cfg.cfg" bind 3 "vstr style_Strong; exec sabers/manual_cfg.cfg" bind 4 "vstr style_Tavion; exec sabers/manual_cfg.cfg" bind 5 "vstr style_Desann; exec sabers/manual_cfg.cfg" bind 6 "vstr style_Staff; exec sabers/manual_cfg.cfg" bind 7 "vstr style_Dual; exec sabers/manual_cfg.cfg" bind 9 "exec sabers/sabermenu.cfg" bind 0 "exec sabers/weapdefault.cfg"

Echo "^1<=====[ ^3Manual Style Menu ^1]=====> ^7(^2#0^7..^7Exit)" Echo "^2#1^7....^4Fast ^0| ^2#2^7..^3Medium ^0| ^2#3^7.......^1Strong ^0| ^2#4^7..^5Tavion Echo "^2#5^7..^1Desann ^0| ^2#6^7...^6Staff ^0| ^2#7^7..^2Dual ^2Sabers ^0| ^2#9^7..^7Up ^7Menu"

--------------------- premade_cfg.cfg --------------------- //Initialize Menu // This script is designed to work with JediAcademy, for the use of Programming specific //Saber Style configurations.

bind 1 "exec sabers/pre_singlehand.cfg" bind 2 "exec sabers/pre_deftav.cfg" bind 3 "exec sabers/pre_defdes.cfg" bind 4 "exec sabers/pre_tavdes.cfg" bind 5 "exec sabers/pre_quick.cfg" bind 6 "exec sabers/pre_strong.cfg" bind 0 "exec sabers/sabermenu.cfg"

Echo "^1<=====[ ^3Pre-Made Styles Menu ^1]=====> ^7(^2#0^7..^7Exit)" Echo "^2#1^7..^2One-handed ^2Styles ^0| ^2#2^7........^5Tavion ^0| ^2#3^7..^1Desann Echo "^2#4^7......^5Tavion^0/^1Desann ^0| ^2#5^7..^4Quick ^4Styles ^0| ^2#6^7..^1Heavy ^1Styles"

-------------------- weapdefault.cfg -------------------- bind 1 "weapon 1" bind 2 "weapon 2" bind 3 "weapon 3" bind 4 "weapon 4" bind 5 "weapon 5" bind 6 "weapon 6" bind 7 "weapon 7" bind 8 "weapon 8" bind 9 "weapon 9" bind 0 "weapon 0"

------------------- pre_tavdes.cfg ------------------- //Initialize Menu // This script is designed to work with JediAcademy, for the use of Programming specific //Saber Style configurations.

Echo "^7Saber ^7Style(s) ^7Activated: ^5Tavion^7, ^3Medium^7, ^1Desann^7."

vstr style_Medium vstr style_Tavion vstr style_Desann

exec "sabers/weapdefault.cfg"

------------------ pre_strong.cfg ------------------ //Initialize Menu // This script is designed to work with JediAcademy, for the use of Programming specific //Saber Style configurations.

Echo "^7Saber ^7Style(s) ^7Activated: ^3Medium^7, ^1Strong^7, ^1Desann^7."

vstr style_Desann vstr style_Medium vstr style_Strong

exec "sabers/weapdefault.cfg"

------------------------ pre_singlehand.cfg ------------------------ //Initialize Menu // This script is designed to work with JediAcademy, for the use of Programming specific //Saber Style configurations.

Echo "^7Saber ^7Style(s) ^7Activated: ^5Tavion^7, ^1Desann^7."

vstr style_Tavion vstr style_Desann

exec "sabers/weapdefault.cfg"

----------------- pre_quick.cfg ----------------- //Initialize Menu // This script is designed to work with JediAcademy, for the use of Programming specific //Saber Style configurations.

Echo "^7Saber ^7Style(s) ^7Activated: ^5Tavion^7, ^4Fast^7, ^3Medium^7."

vstr style_Tavion vstr style_Fast vstr style_Medium

exec "sabers/weapdefault.cfg"

------------------ pre_deftav.cfg ------------------ //Initialize Menu // This script is designed to work with JediAcademy, for the use of Programming specific //Saber Style configurations.

Echo "^7Saber ^7Style(s) ^7Activated: ^5Tavion^7, ^3Medium^7, ^1Strong^7."

vstr style_Tavion vstr style_Medium vstr style_Strong

exec "sabers/weapdefault.cfg"

------------------- pre_defdes.cfg ------------------- //Initialize Menu // This script is designed to work with JediAcademy, for the use of Programming specific //Saber Style configurations.

Echo "^7Saber ^7Style(s) ^7Activated: ^4Fast^7, ^3Medium^7, ^1Desann^7."

vstr style_Desann vstr style_Fast vstr style_Medium

exec "sabers/weapdefault.cfg"




Evil_Jedi

Mapper, Skinner, Noob Scripter

50 XP

20th June 2003

0 Uploads

379 Posts

0 Threads

#7 14 years ago

Woa that's some long script that I don't understand anything of.. so i copy that into my autoexec.cfg, and put that in the saber folder? BTW thanks for the first code, it's a LOT easier that way. Im going to try that now.




JaedenRuiner

Crazy Coding SP Guy...

50 XP

27th December 2002

0 Uploads

168 Posts

0 Threads

#8 14 years ago
Evil_JediWoa that's some long script that I don't understand anything of.. so i copy that into my autoexec.cfg, and put that in the saber folder? BTW thanks for the first code, it's a LOT easier that way. Im going to try that now.

No problem on the first code.

No, as you can see there are several headers in that code list to describe each file.

-------------------- sabermenu.cfg --------------------

is the file name. So by perusing that script code you can see there are like 15 total files to create, simply done with Notepad. I primarily use Notepad for everything because i'm used to typing a lot anyway. :chuckle:

anyway, seperate that long code into the seperate files, put those files in the gamedata\base\sabers sub-folder. The autoexec.cfg file goes in the gamedata\base folder, and is basically one line to add to your current autoexec.cfg file. If you don't have a current autoexec.cfg then create one with the afore mentioned Notepad.

Once that is done, i'm sorry but these online forum systems are kinda quirky with data so I have no qualms cut and pasting stuff, so if there was an easier way to post the files I apologize.

As for Understanding what I did there, so you can modify it however you want, here is a Simple breakdown of script code:

bind 1 "exec sabers/def_dingle.cfg" // This uses Two commands: BIND and EXEC, exec "runs" a cfg "config" file from the relative path starting at gamedata\base. //So autoexec.cfg is in the GameData\Base directory, you'd do this in a cfg

exec autoexec.cfg

//However the sabers folder, containing all the other scripts needs to have the relative path listed

exec sabers/def_dual.cfg

/* SET - basically sets a "variable" to a "value" in the Quake3 cfg script you can set strings with multiple listings of commands. The benefit of this is more than just what you did with the binding. */ //eg:

bind 1 "setforcelighting 1; setforcejump 3"

// it is cleaner (in my programmatic mind) to set up the varible as such

set forcepowers "setforcelighting 1; setforcejump 3"

bind 1 "vstr forcepowers"

/* VSTR is like the EXEC command but instead of "parsing" external CFG files from the harddisk, VSTR runs the command list from a CVAR variable defined by a SET command. Very helpful in many situations. */

Now to understand the overall code that I provided, I simply did this:

SaberMenu - initializes the numbers at the top of the QWERTY keyboard, usually reserved for you weapon selection. Now those numbers equate to "selections" within a menu. The menu is listed with the ECHO commands. Upon pressing the appropriate menu number, I am using EXEC to load a different CFG file that redesigns the number "menu" for you to select the next option. At the end when the menu system is exited (through menu selections) i reset all the number keys to their original weapon selecting configuration. (weapdefault.cfg)

that's pretty much it. This is one of the lesser complexities for scripts. If you look in the scripts and binds section of JK2files.com you'll find other script set that allow to move the camera and script certain "moves" to make them easier. There was always the Quake1 CTF days, when the scripts to auto-use the grappling hook were all over the place. It's the same concept really.

I hope this helps some, play around with the scripts, for unlike modding you can very easily update the script without closing the game. just open the console and reexecute the script file, and voila the new information is set. :)

Jaeden "Sifo Dyas" al'Raec Ruiner