PDA

View Full Version : still trouble triggering scripts


clu
11-15-2002, 01:16 PM
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

lassev
11-16-2002, 06:23 AM
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.

clu
11-16-2002, 01:44 PM
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

Kengo
11-16-2002, 08:41 PM
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 :D

War Master
11-17-2002, 01:18 AM
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 );
}

}

}



:fett:

lassev
11-17-2002, 06:35 AM
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.

clu
11-17-2002, 09:48 AM
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

clu
11-19-2002, 05:07 PM
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

legameboy
11-19-2002, 09:07 PM
does anyone know where i can learn scripting?

lassev
11-20-2002, 02:04 AM
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.

legameboy
11-20-2002, 02:59 PM
wait wait wait a second, what manual, and where are the uncompiled scripts, and is a solid trusty scripting tutorial somewhere?

lassev
11-21-2002, 02:06 AM
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.

Dragarius
11-21-2002, 04:45 AM
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?

lassev
11-22-2002, 09:54 AM
Me too! I downloaded it and it worked just as the script included in meant to work.

clu
11-22-2002, 12:54 PM
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