Page 1 of 1
Script error... what does this mean?
Posted: Wed Nov 16, 2005 12:46 am
by LeadHead
I've run into somewhat of a problem in the map I'm making. There is 2 parts to this post. Take a look at the picture:
http://www.leadhead.us/script_error.jpg
1) The part of the screenshot that is circled in red occurs when I try to plant a bomb. On one bomb, I press "use" to plant it, but nothing happens. Then I open the console, and that is what it says. On the other bomb, that message appears in the console, but I
can plant the bomb, and it will blow up fine and everything. Can someone please tell me what this means and how I can fix it?
2) The part circled in yellow occurs after the control room bomb blows up. I have no clue what that error is, so could someone please explain it to me and tell me how to fix it?

One more embarrassing question that I just remembered. This is going to sound really noobish, but how do you make the game read your map as an objective map? I've put my .bsp and .scr and everything in the main/maps/obj folder, but it will only show up as DM or TDM or roundbased. How do I make it playable in objective mode?
Thanks.
***EDIT***
I just tested my map again, but this time when I planted the control room bomb, it did not give me that "usetrigger but failed check" thing this time.

Posted: Wed Nov 16, 2005 3:00 am
by ViPER
You have some conflict in your script that effects the global/obj_dm.scr
If your map is an objective map. Put it in this folder
maps/obj
If you still have a problem - post your script.
Posted: Wed Nov 16, 2005 9:22 am
by bdbodger
The map name has to start with obj_ for it to show up as an objective map also I think you will have to start a server it won't work from the map list .
Also about the errors .
failed cansee check
it is part of the script and not an error
if ! (self cansee local.player level.bombusefov level.bomb_use_distance)
println "failed cansee check"
The script is set to check a certain direction and has a fov and distance so although it was triggered possible the player is not close enough or standing in front of the trigger in the fov
if (self.target.destroyed_model != NIL)
The trigger does not target the thing that is going to be destroyed so you get an error . Self is the trigger or maybe the bomb and self.target is the thing to be destroyed
Posted: Wed Nov 16, 2005 1:51 pm
by Rookie One.pl
Nothing to worry about, it's just because the obj_dm script was poorly written (no proper exception handling).

These errors also show up in stock maps, so don't bother and just ignore them.
obj_dm
Posted: Wed Nov 16, 2005 10:49 pm
by tltrude
These values are set in the global obj_dm script.
level.bomb_use_distance = 128 //quake units
level.bombusefov = 30 //field of view 30 degrees
The player has to do three things to set a bomb (other than holding down the use key).
1. Must be alive.
2. Must be within 128 units of the trigger.
3. Must be facing the trigger.
Number 3 will give the "cansee" error if the player turns away while setting the bomb. It could also be that the trigger is not the right size or in the right place.
Posted: Thu Nov 17, 2005 12:51 am
by bdbodger
I guess since the bomb calls the obj_dm.scr then self is the bomb and it is the bomb that must target the thing being destroyed . The destroyed_model key does not have to se set it can be NIL
Posted: Thu Nov 17, 2005 1:30 am
by LeadHead
OK, so I fixed the issue of my map not showing up as an objective map, but I am still a little confused about the bomb.
The player has to do three things to set a bomb (other than holding down the use key).
1. Must be alive.
2. Must be within 128 units of the trigger.
3. Must be facing the trigger.
Number 3 will give the "cansee" error if the player turns away while setting the bomb. It could also be that the trigger is not the right size or in the right place.
When I go to plant the V2 bomb, I am alive, within 128 units of the trigger, and am facing the trigger... or at least I think I am. There must be something that I am not doing, but I don't know what it is. Also, when you say the trigger has to be the right size, what is the ideal size that it is supposed to be? >> (Actually, I may have an idea as to why there is something wrong with this trigger. This is right by the place where there is that invisable wall [which I still haven't fixed... I haven't had the time to work on it]. Maybe the wall is interfering with the trigger. I will start working on fixing that now.)
Nothing to worry about, it's just because the obj_dm script was poorly written (no proper exception handling). These errors also show up in stock maps, so don't bother and just ignore them.
Thanks for that piece of info Rookie. I guess I haven't noticed that before in stock maps. This makes me feel better.
And once again thanks to all for replying.

Posted: Thu Nov 17, 2005 3:05 am
by LeadHead
I removed the V2 model from the map, and now everything works fine. The bombs can be planted fine and everything. Now I just have to figure out how to get the V2 back into the map without it doing the same thing that happened before. Any suggestions?
rocket
Posted: Thu Nov 17, 2005 6:03 am
by tltrude
If the rocket has a targetname, you can put this near the top of the script.
$myrocket notsolid
Posted: Thu Nov 17, 2005 8:21 pm
by LeadHead
The rocket does have a targetname, but it is 'exploder' because I want it to disappear when the bomb blows up. If I do '$exploder notsolid', won't the metal clips that are positioned over the rocket (which also have the targetname 'exploder') also become not solid, allowing the player to walk right through the rocket?
So would there be a way for the rocket to be not solid, but the clips to be solid at the same time?
I will try the notsolid thing anyway just to see what happens. Just to be sure... where exactly should I put that command in my script? Before level wattill prespawn? After? Thanks.
exploder
Posted: Sat Nov 19, 2005 7:26 am
by tltrude
OK, I see now. I have had that problem before too. Yes, If you put "$exploder notsolid", all exploders will be non solid. I think there is a way to give it a second targetname, but I can remember how.
If nothing else works, you can always make your own version of the exploder script. Just call it "global/rocket_exploder.scr", or whatever. Then you can comment out the line that makes the exploder solid--if you can find it.
Posted: Sat Nov 19, 2005 2:09 pm
by LeadHead
Thank you very much. I will look around to see if I can find out how to give it a second targetname, but if that doesn't work I will try the script thing that you said. Thanks again.
Posted: Sat Nov 19, 2005 3:07 pm
by LeadHead
Fixed!
What I did was first look at obj_team2 to see how they did it with a script model. Turns out that the actual V2 model did NOT have a targetname of 'exploder' (which is what I originally thought) but instead has a totally different targetname (in my case, it is simply 'v2'). Then the bomb model has a target of 'v2.' In the end, there is a little blue line drawn from the bomb model to the V2 model. Then, when the bomb goes off, the V2 disappears!

I am a very happy man!! Thanks again everyone!
Posted: Sun Nov 20, 2005 9:16 am
by bdbodger
You see that goes back to your original error
if (self.target.destroyed_model != NIL)
The obj_dm.scr removes the model and if you had a destroyed version of it you could set that key on the rocket .