Home   Help Search Login Register  

Author Topic: editing a script  (Read 767 times)

0 Members and 1 Guest are viewing this topic.

Offline Tenchu

  • Members
  • *
  • No Comment
editing a script
« on: 23 Oct 2002, 01:38:04 »
Hi  ;D

I downloaded the second version of the navalstrike script from the depot and am having problems ???

The first one being i don't want a naval strike, I want to use it to simulate fireing from those cannons.

So this is the bit I think i need

_shippos = getpos _ship
   _shipx = _shippos select 0
   _shipy = _shippos select 1
   _smokex = _shipx + _dx
   _smokey = _shipy + _dy
   smoke1 setpos [_smokex,_smokey,20]
   flare1 = "FlareYellow" CamCreate [getpos smoke1 select 0, getpos smoke1 select 1, (getpos smoke1 select 2) + 19.7]
        ~1
        smoke1 setdammage 1
        ~1
        playsound "cannon1"
        deletevehicle flare1
        smoke1 setpos [0,0,0]
   smoke1 setdammage 0

and i converted it to this

_cannonpos = getpos _cannon1
   _cannon1x = _cannon1pos select 0
   _cannon1y = _cannon1pos select 1
   _smokex = _cannon1x +1 this plus 1 should be how to get the end of the barrel, if it's in the right direction  :P
   _smokey = _cannon1y
   smoke1 setpos [_smokex,_smokey,0]
   flare1 = "FlareYellow" CamCreate [getpos smoke1 select 0, getpos smoke1 select 1, getpos smoke1 select 2]
        ~1
        smoke1 setdammage 1
        ~1
        deletevehicle flare1
        smoke1 setpos [0,0,0]
   smoke1 setdammage 0

but it doe'snt work it says Error type any expected ......something(it goes off screen)

Can anyone understand what i just said  :-\ and can u help  :'( please
There is a time and a place for the use of weapons.
- Miyamoto Musashi, The Book of Five Rings, The Ground Book

Bremmer

  • Guest
Re:editing a script
« Reply #1 on: 23 Oct 2002, 10:43:53 »
Hello Tenchu

This may be the problem:

Quote
_cannonpos = getpos _cannon1
   _cannon1x = _cannon1pos select 0
   _cannon1y = _cannon1pos select 1

You haven't defined the variable _cannon1pos. I think this should be _cannonpos.

 :)