Need some help here

Post your scripting questions / solutions here

Moderator: Moderators

Post Reply
7th Es Cyborg
First Lieutenant
Posts: 189
Joined: Fri Dec 13, 2002 5:00 pm
Location: PA
Contact:

Need some help here

Post by 7th Es Cyborg »

need some help

when i turn on developer while running my map - mohaa flips out with this

^~^~^ Script Error: binary '+' applied to incompatible types 'NIL' and 'vector'

file 'global/spotlight.scr'

^~^~^ Script Error: Field 'angles' applied to NULL listener

file 'global/spotlight.scr'

^~^~^ Script Error: binary '-' applied to incompatible types 'NIL' and 'vector'

file 'global/spotlight.scr'

^~^~^ Script Error: Cannot cast 'NIL' to vector

file 'global/spotlight.scr'

^~^~^ Script Error: binary '*' applied to incompatible types 'NIL' and 'float'

file 'global/spotlight.scr'


over and over again nonstop - and it's causing major system lag
7th Es Cyborg
First Lieutenant
Posts: 189
Joined: Fri Dec 13, 2002 5:00 pm
Location: PA
Contact:

Post by 7th Es Cyborg »

can't figure out how to fix this, here are some screen shots of the way I've got my spotlights set up - I've got them targeting the path, but there is the script object still there as if it was still connected to the mg gunner so the light will track anyone it locks on too. The lights are functional, but the lag it creates with only one person in it is bad, with 2 on the map - you can't move - shoot out the lights and everything is normal.

Image

Image

Image

Image

if anyone can tell me how to set this up right so the spotlights still follow the path and target anyone who they find, but won't try to make the mg fire, please please please ( can I beg anymore? ) let me know.
7th Es Cyborg
First Lieutenant
Posts: 189
Joined: Fri Dec 13, 2002 5:00 pm
Location: PA
Contact:

Post by 7th Es Cyborg »

I'm yanking out the spotlights for now - If someone can figure this out for a later map, thanks, but for now I'm killing the idea......... :cry:
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post by jv_map »

Well the error message is supposed to say more than you posted above :?.
Image
7th Es Cyborg
First Lieutenant
Posts: 189
Joined: Fri Dec 13, 2002 5:00 pm
Location: PA
Contact:

Post by 7th Es Cyborg »

well in 30 secs of running the map the log file hit 1,908 kb - that's how much it is pouring in - I've got the spotlight targeting the path rather than the mg gunner, and from what I can understand in the spotlight.scr, it needs the gunner there to work properly - I just haven't a clue how to make it follow the path and lock on to players but not attempt to trigger a mg gunner.......
User avatar
mohaa_rox
Field Marshal
Posts: 2760
Joined: Mon Nov 11, 2002 7:05 am
Contact:

Post by mohaa_rox »

The script error means that your spotlights are set wrongly. Gotta ask Surgeon to do an example map on this. Even I can't figure it out. :oops:
Live to map, not map to live.
-mohaa_rox, .map
moderator
7th Es Cyborg
First Lieutenant
Posts: 189
Joined: Fri Dec 13, 2002 5:00 pm
Location: PA
Contact:

Post by 7th Es Cyborg »

from what I see the problem lies in the spotlight.scr file. It would have to be rewritten to make it work right. I know some very basic coding, enought to kind of understand the flow of the script, but not enough to actually know how to fix it.
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post by jv_map »

Well it means the script cannot retrieve some necessary data. It should at least quote you a line from the spotlight script and give you a line number.
Image
7th Es Cyborg
First Lieutenant
Posts: 189
Joined: Fri Dec 13, 2002 5:00 pm
Location: PA
Contact:

Post by 7th Es Cyborg »

here are the line errors:

local.org[local.i] = (local.org[local.i] * (1 - local.trans)) + (local.dest[local.i] * local.trans) (global/spotlight.scr, 835)

local.vect = $player.origin - self.origin (global/spotlight.scr, 615)

local.vect = vector_normalize (local.vect) (global/spotlight.scr, 616)

local.angles = angles_toforward ($player.angles) (global/spotlight.scr, 618)

local.vect[0] = local.vect[0] * local.angles[0] (global/spotlight.scr, 619)

local.vect[1] = local.vect[1] * local.angles[1] (global/spotlight.scr, 620)

local.vect[2] = local.vect[2] * local.angles[2] (global/spotlight.scr, 621)

local.org1 = $player.origin + (0 0 64) (global/spotlight.scr, 624)

local.ang1 = $player.angles (global/spotlight.scr, 625)

local.v1 = vector_normalize (local.org1 - local.org2) (global/spotlight.scr, 635)

local.f1 = local.v1[0] * local.v2[0] + local.v1[1] * local.v2[1] + local.v1[2] * local.v2[2] (global/spotlight.scr, 638)

if(local.f1 > 0) (global/spotlight.scr, 639)

local.spottargetorigin = level.spottarget.origin (global/spotlight.scr, 690)

if (vector_length(self.spotlight.origin - local.spottargetorigin) < self.lightdist) (global/spotlight.scr, 693)

self.spotter type_idle "machinegunner" (global/spotlight.scr, 391)

self.spotter type_attack "machinegunner" (global/spotlight.scr, 392)

those aren't all of them, but they all link to a machinegunner in the spotlight.scr
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post by jv_map »

Sorry for annoying you, but this still isn't everything :? .

You've omitted the most important lines :( .

Maybe you could just copy a part of the raw logfile?

Well a small part that is, no reason to copy the same error 200 times :wink:
Image
7th Es Cyborg
First Lieutenant
Posts: 189
Joined: Fri Dec 13, 2002 5:00 pm
Location: PA
Contact:

Post by 7th Es Cyborg »

sry JV - not sure all what you needed - here is a few chunks out of the log

Cvar_Set2: cg_te_mode_name Temp Emitter Off
Cvar_Set2: ui_timemessage
Cvar_Set2: subtitle0
Cvar_Set2: subtitle1
Cvar_Set2: subtitle2
Cvar_Set2: subtitle3
Cvar_Set2: cg_te_mode_name Temp Emitter Off
Cvar_Set2: ui_timemessage
Cvar_Set2: subtitle0
Cvar_Set2: subtitle1
Cvar_Set2: subtitle2
Cvar_Set2: subtitle3
local.spottargetorigin = level.spottarget.origin (global/spotlight.scr, 690)
local.spottargetorigin = level.spottarget^

^~^~^ Script Error: Field 'origin' applied to NULL listener

if (vector_length(self.spotlight.origin - local.spottargetorigin) < self.lightdist) (global/spotlight.scr, 693)
if (vector_length(self.spotlight.origin ^

^~^~^ Script Error: binary '-' applied to incompatible types 'vector' and 'NIL'

if (vector_length(self.spotlight.origin - local.spottargetorigin) < self.lightdist) (global/spotlight.scr, 693)
if (^

^~^~^ Script Error: Cannot cast 'NIL' to vector

if (vector_length(self.spotlight.origin - local.spottargetorigin) < self.lightdist) (global/spotlight.scr, 693)
if (vector_length(self.spotlight.origin - local.spottargetorigin) ^

^~^~^ Script Error: binary '<' applied to incompatible types 'NIL' and 'float'

local.spottargetorigin = level.spottarget.origin (global/spotlight.scr, 690)
local.spottargetorigin = level.spottarget^

^~^~^ Script Error: Field 'origin' applied to NULL listener

if (vector_length(self.spotlight.origin - local.spottargetorigin) < self.lightdist) (global/spotlight.scr, 693)
if (vector_length(self.spotlight.origin ^

^~^~^ Script Error: binary '-' applied to incompatible types 'vector' and 'NIL'

if (vector_length(self.spotlight.origin - local.spottargetorigin) < self.lightdist) (global/spotlight.scr, 693)
if (^

^~^~^ Script Error: Cannot cast 'NIL' to vector

if (vector_length(self.spotlight.origin - local.spottargetorigin) < self.lightdist) (global/spotlight.scr, 693)
if (vector_length(self.spotlight.origin - local.spottargetorigin) ^

^~^~^ Script Error: binary '<' applied to incompatible types 'NIL' and 'float'




^~^~^ Script Error: Cannot cast 'NIL' to float

local.org[local.i] = (local.org[local.i] * (1 - local.trans)) + (local.dest[local.i] * local.trans) (global/spotlight.scr, 835)
local.org[local.i] = (local.org[local.i] * (1 - local.trans)) + (local.dest[local.i] ^

^~^~^ Script Error: binary '*' applied to incompatible types 'NIL' and 'float'

local.org[local.i] = (local.org[local.i] * (1 - local.trans)) + (local.dest[local.i] * local.trans) (global/spotlight.scr, 835)
local.org[local.i] = (local.org[local.i] * (1 - local.trans)) ^

^~^~^ Script Error: binary '+' applied to incompatible types 'float' and 'NIL'

local.org[local.i] = (local.org[local.i] * (1 - local.trans)) + (local.dest[local.i] * local.trans) (global/spotlight.scr, 835)
local.org^

^~^~^ Script Error: Cannot cast 'NIL' to float

local.spottargetorigin = level.spottarget.origin (global/spotlight.scr, 690)
local.spottargetorigin = level.spottarget^

^~^~^ Script Error: Field 'origin' applied to NULL listener

if (vector_length(self.spotlight.origin - local.spottargetorigin) < self.lightdist) (global/spotlight.scr, 693)
if (vector_length(self.spotlight.origin ^

^~^~^ Script Error: binary '-' applied to incompatible types 'vector' and 'NIL'

if (vector_length(self.spotlight.origin - local.spottargetorigin) < self.lightdist) (global/spotlight.scr, 693)
if (^

^~^~^ Script Error: Cannot cast 'NIL' to vector

if (vector_length(self.spotlight.origin - local.spottargetorigin) < self.lightdist) (global/spotlight.scr, 693)
if (vector_length(self.spotlight.origin - local.spottargetorigin) ^

^~^~^ Script Error: binary '<' applied to incompatible types 'NIL' and 'float'

local.spottargetorigin = level.spottarget.origin (global/spotlight.scr, 690)
local.spottargetorigin = level.spottarget^

^~^~^ Script Error: Field 'origin' applied to NULL listener

if (vector_length(self.spotlight.origin - local.spottargetorigin) < self.lightdist) (global/spotlight.scr, 693)
if (vector_length(self.spotlight.origin ^


^~^~^ Script Error: Cannot cast 'NIL' to float

local.vect = $player.origin - self.origin (global/spotlight.scr, 615)
local.vect = $player^

^~^~^ Script Error: Field 'origin' applied to NULL listener

local.vect = $player.origin - self.origin (global/spotlight.scr, 615)
local.vect = $player.origin ^

^~^~^ Script Error: binary '-' applied to incompatible types 'NIL' and 'vector'

local.vect = vector_normalize (local.vect) (global/spotlight.scr, 616)
local.vect = ^

^~^~^ Script Error: Cannot cast 'NIL' to vector

local.angles = angles_toforward ($player.angles) (global/spotlight.scr, 618)
local.angles = angles_toforward ($player^

^~^~^ Script Error: Field 'angles' applied to NULL listener

local.angles = angles_toforward ($player.angles) (global/spotlight.scr, 618)
local.angles = ^

^~^~^ Script Error: Cannot cast 'NIL' to vector

local.vect[0] = local.vect[0] * local.angles[0] (global/spotlight.scr, 619)
local.vect[0] = local.vect[0] ^

^~^~^ Script Error: binary '*' applied to incompatible types 'NIL' and 'NIL'

local.vect[1] = local.vect[1] * local.angles[1] (global/spotlight.scr, 620)
local.vect[1] = local.vect[1] ^

^~^~^ Script Error: binary '*' applied to incompatible types 'NIL' and 'NIL'

local.vect[2] = local.vect[2] * local.angles[2] (global/spotlight.scr, 621)
local.vect[2] = local.vect[2] ^

^~^~^ Script Error: binary '*' applied to incompatible types 'NIL' and 'NIL'

local.org1 = $player.origin + (0 0 64) (global/spotlight.scr, 624)
local.org1 = $player^

^~^~^ Script Error: Field 'origin' applied to NULL listener

local.org1 = $player.origin + (0 0 64) (global/spotlight.scr, 624)
local.org1 = $player.origin ^

^~^~^ Script Error: binary '+' applied to incompatible types 'NIL' and 'vector'

local.ang1 = $player.angles (global/spotlight.scr, 625)
local.ang1 = $player^
Surgeon
Site Admin
Posts: 1386
Joined: Tue Jun 04, 2002 1:15 am
Location: Stirling, Scotland
Contact:

Post by Surgeon »

The whole problem is that the spotlight / gunner combo was made specifically for SP maps......I think you wol dhave to sit down and rewrite the spotlight script totally to get just the spotloght working properly........
Admin
Image

.map Forums

Truth and Honor.
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post by jv_map »

Right. global/spotlight.scr is trying to track a player with the spotlight and is therefore not suited for multiplayer games.
global/spotlight.scr wrote:if (level.spottarget == NIL)
level.spottarget = $player
This line sets level.spottarget to a player array, which is not an entity and can therefore not be followed.

I'm sorry but you'll need a modified version of the script for multiplayer use.
Image
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post by jv_map »

Hmm nice timing 8)
Image
7th Es Cyborg
First Lieutenant
Posts: 189
Joined: Fri Dec 13, 2002 5:00 pm
Location: PA
Contact:

Post by 7th Es Cyborg »

7th Es Cyborg wrote:from what I see the problem lies in the spotlight.scr file. It would have to be rewritten to make it work right. I know some very basic coding, enought to kind of understand the flow of the script, but not enough to actually know how to fix it.
Yah, I figured that was the problem. I really don't know enough about scripting ( I'm still in my programing basics course in college - lol ) to fix it. I'll play around with it over time and see if I can make any sence out of it.

Thanks for the confirmation of where the problem lies, now a few months and a lot of excedrin and I'll figure out how to redo the script - hehehe
Post Reply