Jump to content

ISSUE: Tutorial does not work


Recommended Posts

  • 1 month later...

I would assume it is a problem with either your targetname, spawnflags, or the script used to control it, since the rest is pretty simple... Those 3 things would be easy to overlook or screw up if not taken slowly. Szico will be your best bet here... or possibly have someone take a look at your script? Post pics of your script, and your radiant setup and it will be much easier to get to the bottom of it.

 

I apologize for it taking so long to get an answer, and will focus on picking apart the tutorial right now and see if the problem lies there.

Link to comment

You must be making a mistake somewhere - there are plenty of example maps - all of mine which I use it in have the source files included so you can have a look and see how it was done!

It would help if you explained what youve done, step by step, so we can try and figure out whats going wrong!

Link to comment
  • 2 weeks later...

Your door has no origin, because the origin isn't a part of the func_static, which it needs to be. Also remember, the origin is the "hinges" for the door.

 

Secondly, the trigger targets a "t1". There is no entity with the targetname "t1", so it triggers nothing. The trigger is supposed to trigger a target_scriptrunner, which in turn must be set to run the script. :)

 

From the tutorial:

 

 

 

Next place a target_scriptrunner next to the trigger_multiple. Target the trigger to the scriptrunner. Then select just the scriptrunner, and bring up the entity properties. You will need to add the following keys and values:

key: count
value: -1

key: usescript
value: rotamap/dooropener
Link to comment

Few things. You don't need the multiple key on the trigger. You aren't going to need multiple entities triggering it in one frame. Not a breaking issue.

 

Second problem. Both rotation tasks had the same exact name. The script was defaulting to the 0 0 0 rotation, thus making it appear like the script is not doing anything.

 

Third problem. When you have a task like that involves a single func_static movement that doesn't need anything else to run, make the task dowait instead of just do. dowait runs the task and waits until it is finished before continuing the script flow.

 

Fourth problem. I made your origin brush smaller and moved it to the edge of the door, where it would logically rotate from.

 

https://www.dropbox.com/s/awau1s20l89vr7d/cic_fixed.rar


P.S.

 

Running your map with developer 1 told me all I needed to know in 2 seconds. Try using it when you have scripting issues. Can save you a load of time.

Link to comment

Thanks, now it works  :)

 

 

As for the "developer 1" thing, I've had it enabled when debugging it myself but I didn't see any error messages in the console or could it be an OpenJK thing/bug ??

 

You should see information about what is happening with triggers and scripts. For instance before I even looked at the script I ran the map with developer 1 and walked into the trigger. I saw that the scripterrunner was triggered and that it rotated the target brush model to angles 0 0 0. That told me that it's was only doing that task each time. Saving me the time of picking through a script to know what is wrong.

Link to comment

You should see information about what is happening with triggers and scripts. For instance before I even looked at the script I ran the map with developer 1 and walked into the trigger. I saw that the scripterrunner was triggered and that it rotated the target brush model to angles 0 0 0. That told me that it's was only doing that task each time. Saving me the time of picking through a script to know what is wrong.

I never saw anything happen other then some white print commands while debugging the full map. Now with that portion, I saw some things in blue written in the console. Never saw that before . . .

 

 

If I may, I have another question: is it possible to program the script so that it plays a sound when the door opens and/or closes ?? I've been trying with the sound option but the moment I compile the script, it gives an error message . . .

Signature.jpg

Link to comment

Yeah, place the sound line in the task.

 

This is what it'd look like:

 

sound_zpsa73807f9.png

 

 

Just make sure you have it setup to the right path. If it doesn't work there is probably an issue with without sound file you are using. Which the console will tell you. Always run your level with developer 1 and devmap mapname. It helps to run sv_pure 0 as well. That way you can make changes to scripts on the fly and do map_restart. It also makes sure that if you placed the files in folders in base instead of inside a pk3 the game will read them.

 

*edit*

 

It should be .wav not .wave in the photo. Whoops.

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...