Home   Help Search Login Register  

Author Topic: The Skill command  (Read 838 times)

0 Members and 1 Guest are viewing this topic.

Offline Gadjuka

  • Members
  • *
  • Programmer
    • Operation Flashpoint: Commander
The Skill command
« on: 12 Jun 2003, 13:47:09 »
Am I scripting bad or doesn't the command skill (skill unit) work in scripts???
The command just returns null.
I use it in a script called by the eventhandler "GetIn" which passes position and unit to the script, then I use skill on that unit to get its skill.
What's wrong?
Currently working on Operation Flashpoint: Commander.
Website: http://www.nordserver.se/commander/

Bremmer

  • Guest
Re:The Skill command
« Reply #1 on: 12 Jun 2003, 14:01:22 »
Are you sure you that the eventhandler is passing the correct variables (ie the unit rather than the vehicle the unit has just got into?)

An easy way to check wuold be to replace references to unit in your script with driver unit.

The skill command works fine in scripts btw.

Offline Gadjuka

  • Members
  • *
  • Programmer
    • Operation Flashpoint: Commander
Re:The Skill command
« Reply #2 on: 12 Jun 2003, 14:22:40 »
Ok, thanks! I'll try that.
I wanted to make sure that it wasn't any stupid "Only-in-triggers" or such!
Currently working on Operation Flashpoint: Commander.
Website: http://www.nordserver.se/commander/

Offline Gadjuka

  • Members
  • *
  • Programmer
    • Operation Flashpoint: Commander
Re:The Skill command
« Reply #3 on: 12 Jun 2003, 20:00:46 »
It's not working! :(
I get the error message:
'_skill = skill _unit': Error Unknown operator _unit

I use a 'hint' to display which unit the script receives. It seem like it get real units, when I enter the hint says:
WEST Bravo Black:1 (Gadjuka)
When my number 2 enters:
WEST Bravo Black:2 and so on

I can't see what's wrong...
« Last Edit: 12 Jun 2003, 20:01:11 by Gadjuka »
Currently working on Operation Flashpoint: Commander.
Website: http://www.nordserver.se/commander/

Offline CrashDome

  • Members
  • *
Re:The Skill command
« Reply #4 on: 12 Jun 2003, 21:08:18 »
Can we see your actual script?

It sounds like you are defining "skill" as a variable somehow or somewhere. I noticed you use _skill as a variable. You should really make it something like _unitskill to minimize confusion.

Bremmer

  • Guest
Re:The Skill command
« Reply #5 on: 12 Jun 2003, 21:20:55 »
I just did a quick test and couldn't find a problem. Heres my script:


;called using get in event handler as below
;this addEventHandler ["GetIn",{_this exec "injeep.sqs"}]
 
_unit = _this select 0
_skill = skill _unit

hint "hello"
hint format ["%1\n%2",_unit,_skill]

exit


Hope this helps a bit

Offline Gadjuka

  • Members
  • *
  • Programmer
    • Operation Flashpoint: Commander
Re:The Skill command
« Reply #6 on: 13 Jun 2003, 00:13:42 »
Thank you everyone!
I apperantly scripted bad! :-[
I had a global variable called skill = not good. I just changed the name to unitSkill, and now it works.
Currently working on Operation Flashpoint: Commander.
Website: http://www.nordserver.se/commander/

Offline CrashDome

  • Members
  • *
Re:The Skill command
« Reply #7 on: 13 Jun 2003, 00:32:21 »
Figured! ;D

Glad to help  8)