Home   Help Search Login Register  

Author Topic: script error  (Read 1649 times)

0 Members and 1 Guest are viewing this topic.

GeneralCoder

  • Guest
script error
« on: 10 Oct 2002, 20:03:16 »

i got error from this line.. though only some times

_man = (_units select index)

i used this to select units from squad and but them to boat but shometimes i get error message "error diversion shometing"
and all units wont goto boat.
i know its hard to say anything about that but maybe u would have some advices for me?

Offline Tomb

  • Contributing Member
  • **
  • in2 Metal? Go 2 my sig
Re:script error
« Reply #1 on: 10 Oct 2002, 22:36:32 »
make a sample mission & post it here, or just post a copy of the scroll, m8
that way, it's much easier to actually give a useful reply  :-* :cheers:


Offline mcnorth

  • Members
  • *
Re:script error
« Reply #2 on: 11 Oct 2002, 00:28:07 »
Tomb's right on with his suggestion. It's easier to isolate and give a good answere with specifics.

Until then I'm guessing you got the zero divisor error. I just beat my brains out with that a few days back and I think it occurs when the index is less than zero. Are you running this in a script or an activation field?

Later,
mcnorth

GeneralCoder

  • Guest
Re:script error
« Reply #3 on: 11 Oct 2002, 01:13:04 »
Allright heres the whole init code of the mission.

Seven groups need instantly get in to the seven higgens boat.

So shometimes error message and some of the soldiers doesnt go in at all.
i havent but anything special to the soldier expect "in cargo" wich though doesnt seem to effect anything in this case.



gindex=0

#Loppi

;// dont know better way to do this...
?(gindex==0):_units = units Group1
?(gindex==1):_units = units Group2
?(gindex==2):_units = units Group3
?(gindex==3):_units = units Group4
?(gindex==4):_units = units Group5
?(gindex==5):_units = units Group6
?(gindex==6):_units = units Group7

index=0

#Loop

_man = (_units select index)

?(gindex==0):_man moveincargo boat1
?(gindex==1):_man moveincargo boat2
?(gindex==2):_man moveincargo boat3
?(gindex==3):_man moveincargo boat4
?(gindex==4):_man moveincargo boat5
?(gindex==5):_man moveincargo boat6
?(gindex==6):_man moveincargo boat7

wsoldiers=wsoldiers+1

index=index+1

?(index<12) : goto "Loop"

gindex=gindex+1

?(gindex<6) : goto "Loppi"

exit

 ::)

Bremmer

  • Guest
Re:script error
« Reply #4 on: 11 Oct 2002, 01:30:12 »
Do some of the soldiers sometimes die before they can get in the boats?

The error arises because somewhere along the line one of your groups is less than twelve units large, therefore when you try to _unit select 12 from an array with only 11 units you get your error.

Heres a much nicer way to get your men into their boats

"_x moveincargo boat1" foreach units group1
"_x moveincargo boat2" foreach units group2
"_x moveincargo boat3" foreach units group3
"_x moveincargo boat4" foreach units group4
"_x moveincargo boat5" foreach units group5
"_x moveincargo boat6" foreach units group6

 :)


GeneralCoder

  • Guest
Re:script error
« Reply #5 on: 11 Oct 2002, 01:43:41 »
Do some of the soldiers sometimes die before they can get in the boats?

The error arises because somewhere along the line one of your groups is less than twelve units large, therefore when you try to _unit select 12 from an array with only 11 units you get your error.

Heres a much nicer way to get your men into their boats

"_x moveincargo boat1" foreach units group1
"_x moveincargo boat2" foreach units group2
"_x moveincargo boat3" foreach units group3
"_x moveincargo boat4" foreach units group4
"_x moveincargo boat5" foreach units group5
"_x moveincargo boat6" foreach units group6

 :)

No

No i check that allready.

But thanks for that code!

though now there isnt error message some guys dont still goto boat - usualy some guys in the last groups.  :-\





Offline mcnorth

  • Members
  • *
Re:script error
« Reply #6 on: 11 Oct 2002, 02:16:39 »
Hey GC,

Post the mission. I'll take a stab at it tonight.

mcnorth

Offline mcnorth

  • Members
  • *
Re:script error
« Reply #7 on: 11 Oct 2002, 06:08:01 »


[attachment deleted by admin]

GeneralCoder

  • Guest
Re:script error
« Reply #8 on: 12 Oct 2002, 13:33:30 »
Check out the attached. The trigger is delayed so you can see the action. Shoot a guy and the movein order passes him up.

I'm sure it could be made more dynamic but I gotta go.

mcnorth

But only new thing in that script is getdammage? im sure the soldiers are ok becose i checked them.. yep there they was standing in the beach healty, so thats not the problem.

And u know i think the problem is higgens boat, becose when units get in to the boat they are placed kinda randomly to there.. just though it might effect.

well anyway this is just minor problem becose theres 84 soldiers in my beach landing and if 2-10 of them never even makes to the boat i would just say they are casulties of war... right?  :-\

i soon release the mission.

Offline mcnorth

  • Members
  • *
Re:script error
« Reply #9 on: 12 Oct 2002, 22:30:43 »
The getdammage part was in case any of your guys have an opportunity to die before they load up. Anyway, it sounds like you're ok with what you've got. I'll look for the mission. 8)

GeneralCoder

  • Guest
Re:script error
« Reply #10 on: 13 Oct 2002, 19:49:44 »
Posted the mission to "mission beta testing forum"
and if theres still this bug report there and i can give the editor files so u can fix it or what ever.