Home   Help Search Login Register  

Author Topic: I get a error messg with this script.  (Read 629 times)

0 Members and 1 Guest are viewing this topic.

FLBEE

  • Guest
I get a error messg with this script.
« on: 10 Jan 2004, 20:12:55 »
This script is called from another script in which the player is setpos in the sameplace as the selected squad member, then the squadmemeber is deletevehicle outta there.It is so the player can take the role of another squad member during the mission.

I get a error messege:
No entry 'config.bin/Cfg weapons.scalar bool array string oxfcffffer'

Then the system gets all laggy.
I'm using non addon weapons. My scripting is basic, so I could be barking up the wrong tree.

note: _this is the squad memeber being replaced by the player

;;;;;;;;;;;;;;;;;;
;FLBEE
;finds a units weapon loadout and gives it to player


_member = _this


_pimary = PrimaryWeapon _memeber
_secondary = SecondaryWeapon _member
_magarray = magazines _memeber
_magnumber = count _magarray

_num = 0
#loop
_mag = _magarray select _num
player addmagazine format ["%1",_mag]
_num = _num + 1
?_num > _magnumber : goto "next"
goto "loop"

#next

player addweapon format ["%1",_primary]
 
player addweapon format ["%1",_secondary]
exit

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re:I get a error messg with this script.
« Reply #1 on: 10 Jan 2004, 20:21:30 »
Check your spelling first.

You have:

_pimary = PrimaryWeapon _memeber

and:

_magarray = magazines _memeber

But the variable is declared as:

_member = _this

Remove the extra 'e' from _memeber to make it _member.



Planck
I know a little about a lot, and a lot about a little.

FLBEE

  • Guest
Re:I get a error messg with this script.
« Reply #2 on: 10 Jan 2004, 20:22:44 »
aaaaaaaahhhh!
I hate when I do that!

Thx--i'll go fix it and give it another try.

FLBEE

  • Guest
Re:I get a error messg with this script.
« Reply #3 on: 10 Jan 2004, 20:26:23 »
Fixing the speeling didn't fix the error.

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re:I get a error messg with this script.
« Reply #4 on: 10 Jan 2004, 20:28:48 »
Whuuups........another spelling mistake.....I missed it first time round

_pimary = PrimaryWeapon _memeber


Should be _primary


Add the extra 'r'


Planck
I know a little about a lot, and a lot about a little.

deaddog

  • Guest
Re:I get a error messg with this script.
« Reply #5 on: 10 Jan 2004, 20:33:26 »
How are you calling the script:

1:  [unitname] exec .....

or

2: unitname exec ......


If it is #1 then it is wrong.

FLBEE

  • Guest
Re:I get a error messg with this script.
« Reply #6 on: 10 Jan 2004, 20:50:19 »
Thx Planck--I have no excuse for that  :)

When I fixed the spelling this time it did fit the player with the primary weapon of the squadmember, but no ammo. And it didn't get all laggy. The error messg persists tho, must be a problem with the way I am calling for the ammo.

Its # 2 deaddog.

Thx for the help.

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re:I get a error messg with this script.
« Reply #7 on: 10 Jan 2004, 20:56:10 »
I think you will need to add the magazines too.....preffereably before the weapon.

Edit ......Forget that........I wasn't thinking right

Planck.

« Last Edit: 10 Jan 2004, 20:58:56 by Planck »
I know a little about a lot, and a lot about a little.

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re:I get a error messg with this script.
« Reply #8 on: 10 Jan 2004, 21:03:34 »
Not sure if it would work.....but instead of your magazine loop, try this:

player addmagazine format ["%1",_magarray]


Try it out anyway.

Or try changing the line in your loop to:

player addmagazine format ["%1",_primary]

Not sure if any of those will work........but experiment.



Planck




« Last Edit: 10 Jan 2004, 21:50:36 by Planck »
I know a little about a lot, and a lot about a little.

FLBEE

  • Guest
Re:I get a error messg with this script.
« Reply #9 on: 11 Jan 2004, 00:13:56 »
I got rid of the format stuff and it sort of works now. I find that  'magazines _unit' command already returns the string names of ammo in the array.
So now I get the weapon of the squad member and his ammo--but first I get a diff error messg : "no entry .model"

I got rid of the format on the primary and secondary and it still works fine.---- player addweapon _primary

Strange though, when the player gets the new weapon it is not ready to shoot until I hit the fire mode button(space for me). Like usually single fire is the standard it starts on. And yes it starts loaded.

Once I hit ok on the grey error messg "no entry model" button and hit the space bar I am ready to continue with the mission

_num = 0
#loop
_mag = _magarray select _num
player addmagazine _mag
_num = _num + 1
?_num > _magnumber : goto "next"
goto "loop"

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re:I get a error messg with this script.
« Reply #10 on: 11 Jan 2004, 02:46:28 »
I cooked up a quick test with your script.

The error about 'no entry .model' does not happen if you comment out, or remove the following line:

player addweapon _secondary

It seems to be the secondary weapon that is causing the problem.


Planck
I know a little about a lot, and a lot about a little.

Offline LCD

  • Former Staff
  • ****
    • Everon Cartel
Re:I get a error messg with this script.
« Reply #11 on: 11 Jan 2004, 03:03:37 »
as 4 da fire mode bug

Quote
...hit the fire mode button(space for me).

use da selectweapon command 2 make it go

unitname selectweapon _primary

LCD OUT
« Last Edit: 11 Jan 2004, 03:03:54 by LCD »
"guess being the community has downsides .." - cheetah
Help Perfecting Da Next Best Thing - O-Team Beta

FLBEE

  • Guest
Re:I get a error messg with this script.
« Reply #12 on: 11 Jan 2004, 03:54:03 »
YES!!

Thats it!  ;D  

THX Planck. The squadmember never had a secondary weapon anyway. It works now with no problems. Also thanks for taking the time to work on this with me throughout the day.

THX LCD. myguy selectweapon _primary did the trick.


you guys rock!

Offline LCD

  • Former Staff
  • ****
    • Everon Cartel
Re:I get a error messg with this script.
« Reply #13 on: 11 Jan 2004, 03:56:59 »
lol

i know dis cuz dat 1 made bugs in ma mision ;) ;D

if all ur probs r solved - use da solve botton - somwere up dere ;)  :-*

:cheers:

LCD OUT
"guess being the community has downsides .." - cheetah
Help Perfecting Da Next Best Thing - O-Team Beta