Mg 42 ai script error

Post your scripting questions / solutions here

Moderator: Moderators

Post Reply
User avatar
martijn_NL
Map Reviewer
Posts: 156
Joined: Mon Apr 14, 2003 5:33 pm
Location: The Netherlands
Contact:

Mg 42 ai script error

Post by martijn_NL »

I added a mg 42 with with ai, just like the tut on .MAP, but i get strange error.
Set stream error - Unable to open file. - sound/vehicle/veh_truck_on.wav
if (self.spawn_left == NIL || self.spawn_left <= 0) (global/mg42_active.scr, 151)
if (self.spawn_left == NIL || self.spawn_left ^

^~^~^ Script Error: binary '<=' applied to incompatible types 'string' and 'int'

if (self.spawn_left == NIL || self.spawn_left <= 0) (global/mg42_active.scr, 151)
if (self.spawn_left == NIL || self.spawn_left ^

^~^~^ Script Error: binary '<=' applied to incompatible types 'string' and 'int'
I think this is realy weird because i didn't make String or int variables. You guys know a solution?
Mapping 4 life
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post by jv_map »

I think there is a minor error in that tut I forgot to fix :oops:

I think you've set (for the mg-42) key/value
$spawn_left / (number)

whereas it should be
#spawn_left / (number)
Image
User avatar
bdbodger
Moderator
Posts: 2596
Joined: Tue Feb 25, 2003 7:34 am
Location: canada
Contact:

Post by bdbodger »

I think the problem is you have to set the number of times they will spawn by setting key:#spawn value: 4 ( or whar ever )

this is in that script
self.spawn_left = self.spawn

mg42_spawn:

if (self.spawn_left == NIL || self.spawn_left <= 0)
end
User avatar
martijn_NL
Map Reviewer
Posts: 156
Joined: Mon Apr 14, 2003 5:33 pm
Location: The Netherlands
Contact:

Post by martijn_NL »

thanks it worked out. The error does not appear any more.

But i have another question about mg42 and ai.
Normaly when the ai is goning to use the mg-42, the ai is going to sit down, which as result that the ai can't see any more ( I made a bunker, almost exactly as manstein's bunker tut). So that's not good. Anybody knows a solution for that.
Mapping 4 life
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post by jv_map »

Hmm try placing the mg-42 a little lower or place the AI on a clip brush so it's higher :)
Image
Post Reply