clu Posted November 15, 2002 Share Posted November 15, 2002 I'm sure I'm missing something obvious here, but I can't get my script to run on my SP level. Here's what I've done: 1) Created a script that changes kyle's force powers all to zero 2) Created a trigger_once trigger around the player_start entity 3) Created a target_scriptrunner that is right in front of the trigger 4) Added the key "Usescript" with a key of "flevels" (the name of my script located in the root of my scripts directory 5) Linked the trigger and target with "control K" When I start my level, nothing happens. Anyway, I'm struggling here. Hope someone sees an obvious mistake/omission. -clu Link to comment Share on other sites More sharing options...
lassev Posted November 16, 2002 Share Posted November 16, 2002 Just two things: Have you set, in your script, the changes to affect kyle with the affect command? Secondly: the better way is to drop out the trigger_once and connect the player_start directly to the script_runner, using the ctrl+K, in the same manner your connected the trigger. Link to comment Share on other sites More sharing options...
clu Posted November 16, 2002 Author Share Posted November 16, 2002 Yep. I read that somewhere else too. I got rid of the trigger_once and now I just have the info_player_start targeted at the scriptrunner. Anyway it still doen't work for some reason. Two questions: 1)Does it matter where the scriptrunner is located (does it need to be on top of or in physical contact with info_player_start?) 2) Does it matter if the script IBI file is in a PK3 file, but the map using the script is just in the "maps" directory? (or do they have to be in the same PK3 file?) Anyway, the script only affects kyle: affect ( "kyle", /*@AFFECT_TYPE*/ FLUSH ) { set ( /*@SET_TYPES*/ "SET_FORCE_HEAL_LEVEL", /*@FORCE_LEVELS*/ "0" ); set ( /*@SET_TYPES*/ "SET_FORCE_JUMP_LEVEL", /*@FORCE_LEVELS*/ "0" ); set ( /*@SET_TYPES*/ "SET_FORCE_SPEED_LEVEL", /*@FORCE_LEVELS*/ "0" ); set ( /*@SET_TYPES*/ "SET_FORCE_PUSH_LEVEL", /*@FORCE_LEVELS*/ "0" ); set ( /*@SET_TYPES*/ "SET_FORCE_PULL_LEVEL", /*@FORCE_LEVELS*/ "0" ); set ( /*@SET_TYPES*/ "SET_FORCE_MINDTRICK_LEVEL", /*@FORCE_LEVELS*/ "0" ); set ( /*@SET_TYPES*/ "SET_FORCE_GRIP_LEVEL", /*@FORCE_LEVELS*/ "0" ); set ( /*@SET_TYPES*/ "SET_FORCE_LIGHTNING_LEVEL", /*@FORCE_LEVELS*/ "0" ); set ( /*@SET_TYPES*/ "SET_SABER_THROW", /*@FORCE_LEVELS*/ "0" ); set ( /*@SET_TYPES*/ "SET_SABER_DEFENSE", /*@FORCE_LEVELS*/ "0" ); set ( /*@SET_TYPES*/ "SET_SABER_OFFENSE", /*@FORCE_LEVELS*/ "0" ); } I'm stumped! -clu Link to comment Share on other sites More sharing options...
Kengo Posted November 17, 2002 Share Posted November 17, 2002 I'm having some problems with doing this at the moment myself, but I think its to do with trying to trigger too many things at the same time... The best way to do scripts in my opinion is to create a folder in the gamedata/base directory called scripts. Then put a sub folder in, called say map. I dunno why, but it seems like you need a subdirectory, you cant just put Usescript scriptname (I'm not certain on this). So in the target_scriptrunner, have Usescript as the key, and say map/scriptname as the value. Sound like you've got the actual set up of the trigger and target_scriptrunner in the map editor all right. You can have the map in the maps folder, the scrpt in the scripts folder, you don't have to put them together into a pk3 to get them to work (which saves a LOT of time). Hope that does the trick, I had a lot of trouble with triggering scripts (and they aven't all gone away...). One other thing, sure you probabaly have but make sure you compile the actual script as well as saving it, sorry, just thought it was worth making sure! The script itself looks fine as well. Good luck Link to comment Share on other sites More sharing options...
War Master Posted November 17, 2002 Share Posted November 17, 2002 I had trouble setting up Kyle without force powers and no saber too. For some reason this script will work on Kyle, it's part of the one for kejim_post. If you don't want him to have a saber make sure you check stun baton in the info player start properties. One last thing, when you try out your map don't load it from the menu, type devmap "mymap" to start it. //Generated by BehavEd rem ( "set up force powers and weapons" ); affect ( "kyle", /*@AFFECT_TYPE*/ FLUSH ) { set ( /*@SET_TYPES*/ "SET_FORCE_JUMP_LEVEL", /*@FORCE_LEVELS*/ "0" ); set ( /*@SET_TYPES*/ "SET_FORCE_PUSH_LEVEL", /*@FORCE_LEVELS*/ "0" ); set ( /*@SET_TYPES*/ "SET_FORCE_PULL_LEVEL", /*@FORCE_LEVELS*/ "0" ); set ( /*@SET_TYPES*/ "SET_FORCE_SPEED_LEVEL", /*@FORCE_LEVELS*/ "0" ); set ( /*@SET_TYPES*/ "SET_FORCE_HEAL_LEVEL", /*@FORCE_LEVELS*/ "0" ); set ( /*@SET_TYPES*/ "SET_FORCE_GRIP_LEVEL", /*@FORCE_LEVELS*/ "0" ); set ( /*@SET_TYPES*/ "SET_FORCE_MINDTRICK_LEVEL", /*@FORCE_LEVELS*/ "0" ); set ( /*@SET_TYPES*/ "SET_FORCE_LIGHTNING_LEVEL", /*@FORCE_LEVELS*/ "0" ); set ( /*@SET_TYPES*/ "SET_SABER_THROW", /*@FORCE_LEVELS*/ "0" ); set ( /*@SET_TYPES*/ "SET_SABER_DEFENSE", /*@FORCE_LEVELS*/ "0" ); set ( /*@SET_TYPES*/ "SET_SABER_OFFENSE", /*@FORCE_LEVELS*/ "0" ); if ( $get( FLOAT, "SET_SKILL") = 0$ ) { set ( /*@SET_TYPES*/ "SET_ARMOR", 100 ); } else ( ) { if ( $get( FLOAT, "SET_SKILL") = 1$ ) { set ( /*@SET_TYPES*/ "SET_ARMOR", 50 ); } } } Link to comment Share on other sites More sharing options...
lassev Posted November 17, 2002 Share Posted November 17, 2002 Well, I still say it's better to target the info_player_start to the script_runner. If nothing else, it looks better in the editor. Otherwise there's no demands beyond that. Just make sure with view show path that the connections is okay and to the right direction. It doesn't matter in the short run if you just keep you custom, compiled scripts in a subfolder called scripts in the base folder. However, I cannot but strongly recommend putting them in a subfolder named after your map in the scripts folder, and put the respective path name in the usescript key, as Kengo pointed out. Like: usescript mymapname/myspawnscript This will ensure there's some order left if you ever happen to make more than one map that use scripts. Not to mention if those scripts have same names with different contents. When you make your pk3-file, first create a folder called scripts (along with folder maps, where your compiled map is and a folder textures, and such), and inside the scripts folder a subfolder named after your map (mymapname), again. Then put your scripts in that subfolder. A bit messy, but luckily these are things you only need to learn once. Link to comment Share on other sites More sharing options...
clu Posted November 17, 2002 Author Share Posted November 17, 2002 Thanks for all the replies. I've done everything and unless I'm missing something, there's still some problem with the map (I don't think it's the script, because I tries triggering just normal scripts that come with the game as well). Anyway, if anyone is still curious, I've posted a PK3 file with the map (bsp and map) and script (txt and ibi) up on the web: http://www.jakekeating.com/pub/jake01.pk3 You can extract the PK3 to have a look at the files or just dump it in the base folder to try out the test level. Anyway, thanks much again for all the help. -clu Link to comment Share on other sites More sharing options...
clu Posted November 19, 2002 Author Share Posted November 19, 2002 Anyone? Anyone? Just need another set of eyes to look at the files. I'm beggin' here. The URL is in the last post: -clu Link to comment Share on other sites More sharing options...
legameboy Posted November 20, 2002 Share Posted November 20, 2002 does anyone know where i can learn scripting? Link to comment Share on other sites More sharing options...
lassev Posted November 20, 2002 Share Posted November 20, 2002 Absolutely best way to learn ICARUS scripting is to read the manual and then study the uncompiled game scripts Raven gave out, and every now and then study the manual again. There's no better way, trust me. If you don't trust me, trust the Force, it will tell you the same. Link to comment Share on other sites More sharing options...
legameboy Posted November 20, 2002 Share Posted November 20, 2002 wait wait wait a second, what manual, and where are the uncompiled scripts, and is a solid trusty scripting tutorial somewhere? Link to comment Share on other sites More sharing options...
lassev Posted November 21, 2002 Share Posted November 21, 2002 I trust you have, legameboy, downloaded the second version of the editing tools package? It's months old, so you should have. If you have uncompressed (unzipped) the package, you should have in your tools folder a subfolder called scripts (of was it SP_scripts, or something). There are all the scripts in a text format the BehaveED can read. Also in the package is an ICARUS manual. Unfortunately that manual is not a beginner's guide, but you actually have to try'n'try the examples and such before the manual begins to make deeper sense. Still, many of the common errors are descriped in the manual and you should indeed pay heed to them. As far as I know, there is no solid tutorial for scripting. The area is as far and wide as are the possibilities. There was a tutorial about moving NPCs and camera commands, but having mastered those skills earlier, I don't remember the location. Link to comment Share on other sites More sharing options...
Dragarius Posted November 21, 2002 Share Posted November 21, 2002 Originally posted by clu Anyone? Anyone? Just need another set of eyes to look at the files. I'm beggin' here. The URL is in the last post: -clu It seems you figured it out but didn't post? I downloaded the link and Kyle starts with no force powers. That was the intent wasn't it? Link to comment Share on other sites More sharing options...
lassev Posted November 22, 2002 Share Posted November 22, 2002 Me too! I downloaded it and it worked just as the script included in meant to work. Link to comment Share on other sites More sharing options...
clu Posted November 22, 2002 Author Share Posted November 22, 2002 That's weird. It didn't work in the last PK3 file I had, but in the one I posted for you guys. It seems to work fine. Maybe I had some stuff in the other PK3 that was messing up the script? Anyway, I think the suggestion to have info_player_start trigger the script is what ended up working. Thanks so much for all the help! That was driving me nuts. -clu Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.