Scripting error!

Post your scripting questions / solutions here

Moderator: Moderators

Post Reply
User avatar
dude77
Corporal
Posts: 49
Joined: Tue Sep 01, 2009 8:37 pm

Scripting error!

Post by dude77 »

HELP ME!!!! PLEASE!!!
i made a small map and got 1 allied soldier to follow me, when i go into a room with a german in it it freezes and quits me out from the game and on the console it says this:

~~script error: cannot cast 'NIL' to float
wait self.waittime (global/friendly.scr, 1172)

~~script error: cannot cast 'NIL' to float
while (isalive self) (global/friendly.scr, 228)

***********************************
ERROR: Command Overflow. Possible infinite loop in thread.
***********************************
----- server shutdown -----
==== shutdown game ====

-----------------------------------



any help Sad
User avatar
211476
Captain
Posts: 273
Joined: Fri Feb 29, 2008 2:20 am
Location: Arizona, USA
Contact:

Post by 211476 »

please next time, stick it to you last thread, and don't use all those exclamation points
Image
Rookie One.pl
Site Admin
Posts: 2752
Joined: Fri Jan 31, 2003 7:49 pm
Location: Nowa Wies Tworoska, Poland
Contact:

Post by Rookie One.pl »

Post your script. And also don't use so many exclamation marks, it hurts the eyes. I removed the excessive ones for you.
Admin
Image
Image
Honour guide me.

here's my stuff - inequation.org | here's where I work - thefarm51.com
User avatar
dude77
Corporal
Posts: 49
Joined: Tue Sep 01, 2009 8:37 pm

Post by dude77 »

sorry about that, its because i havent had a reply in a while and its bugging me that it wont work!
script:

exec global/auto.scr

level waittill prespawn
level waittill spawn

main:

thread FriendInit

end

FriendInit:


level.friendly1.targetname = friend1
level.friendly2.targetname = friend2
level.friendly3.targetname = friend3

$friend1.destination = $player
$friend2.destination = $player
$friend3.destination = $player

$friend1.friendtype = 1
$friend2.friendtype = 1
$friend3.friendtype = 1

$friend1.distance = 175
$friend2.distance = 225
$friend3.distance = 250

$friend1 thread global/friendly.scr::friendlythink
$friend2 thread global/friendly.scr::friendlythink
$friend3 thread global/friendly.scr::friendlythink

end

thanks

:)
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post by jv_map »

You need a call 'exec global/friendly.scr', I think just below level waittill prespawn.
Image
Smithy
Corporal
Posts: 46
Joined: Fri Aug 18, 2006 8:54 pm
Location: United Kingdom

Post by Smithy »

I think exec global/auto.scr includes that. I could be wrong though.


EDIT:

Yeah it does.
main local.script:

if ( level.auto_script_run == 1 )
{
end
}

if ( local.script != NIL )
{
if ( level.script == NIL )
{
level.script = ("maps/" + local.script + ".scr")
}
}

exec global/loadout.scr
exec global/ai.scr
exec global/exploder.scr
exec global/turret.scr

level waittill prespawn

exec global/door_locked.scr
exec global/friendly.scr
exec global/ambient.scr local.script
exec global/bomber.scr

level.auto_script_run = 1

level waittill spawn

dude77, look on your other thread and look at my post, it may help.
User avatar
dude77
Corporal
Posts: 49
Joined: Tue Sep 01, 2009 8:37 pm

Post by dude77 »

no luck :(
Post Reply