Home   Help Search Login Register  

Author Topic: Problems with script- probably simple!  (Read 1480 times)

0 Members and 2 Guests are viewing this topic.

Offline wired

  • Members
  • *
  • Explosion Scripter for the [unsung] mod!!!
Problems with script- probably simple!
« on: 17 Jan 2004, 23:14:13 »
Im having a problem with one of my scripts. _mine is just a normal mine. When it explodes or gets dammaged, i want it to do an effect......
Quote
_mine = _this select 0
_dammage = (getdammage _mine)
#al
~0.000001
? _dammmage >0:goto "ex1"
? _dammmage ==0:goto "al"
goto "al"
#ex1
setacctime 0.05
(then the effect here!)

but when i call the mine (   [this] exec "mine.sqs" ) it dont work!
why? i know its something in this part of the script cos it doesn't slow the time down as it shud.



HELP!!!!!
We have a problem at 'Oscar-Charlie 2-7' do you read me? Well its that guy with the RPG!

Offline Artak

  • The old beanbag shaker
  • Former Staff
  • ****
  • You want to talk about it, yes?
    • OFP Team Finlanders
Re:Problems with script- probably simple!
« Reply #1 on: 17 Jan 2004, 23:21:11 »
Check your spelling. First the BIS screwed up with the spelling of damage and made it dammage. Now you're adding even a third m and making it dammmage later in the script  ;D ;)
Not all is lost.

Offline wired

  • Members
  • *
  • Explosion Scripter for the [unsung] mod!!!
Re:Problems with script- probably simple!
« Reply #2 on: 17 Jan 2004, 23:38:25 »
nope, didn't solve it
We have a problem at 'Oscar-Charlie 2-7' do you read me? Well its that guy with the RPG!

Offline icarus_uk

  • Members
  • *
  • LiarLiarPants Inflame True
    • [furryclan]
Re:Problems with script- probably simple!
« Reply #3 on: 18 Jan 2004, 00:02:45 »
Its because you cant getdammage of a mine.

Your line;

_dammage = (getdammage _mine)

Returns an error, and so _dammage is never greater than 0.

Offline wired

  • Members
  • *
  • Explosion Scripter for the [unsung] mod!!!
Re:Problems with script- probably simple!
« Reply #4 on: 18 Jan 2004, 00:05:39 »
so how can i tell if A mine goes bang?
We have a problem at 'Oscar-Charlie 2-7' do you read me? Well its that guy with the RPG!

Offline icarus_uk

  • Members
  • *
  • LiarLiarPants Inflame True
    • [furryclan]
Re:Problems with script- probably simple!
« Reply #5 on: 18 Jan 2004, 00:09:22 »
I'll tell when I figure it out myself :)  Ive tried a few things now, and nothings worked.

Offline icarus_uk

  • Members
  • *
  • LiarLiarPants Inflame True
    • [furryclan]
Re:Problems with script- probably simple!
« Reply #6 on: 18 Jan 2004, 00:23:48 »
Nopes, Ive tried everything I can think of;

Getdammage, doesnt work.

Fuel, doesnt work (that was more a shot in the dark)

I even tried Getpos to see if that would start a script, but even using Getpos on a mine returns errors.

I cant think of anything else, hopefully someone else will.

Offline MachoMan

  • Honoured
  • Former Staff
  • ****
  • KISS, Keep it Simple Stupid
Re:Problems with script- probably simple!
« Reply #7 on: 18 Jan 2004, 00:26:57 »
how about:
Code: [Select]
? !alive _mine : bla bla
Get those missions out there you morons!

Offline icarus_uk

  • Members
  • *
  • LiarLiarPants Inflame True
    • [furryclan]
Re:Problems with script- probably simple!
« Reply #8 on: 18 Jan 2004, 01:32:45 »
Oh yes, that was another one I tried.  No it didnt work.
« Last Edit: 18 Jan 2004, 01:32:54 by [icarus_uk] »

deaddog

  • Guest
Re:Problems with script- probably simple!
« Reply #9 on: 18 Jan 2004, 04:18:01 »
Place a small trigger over the mine, size 4X4 meters.
anybody present
condition:  "tank" counttype thislist > 0
activation : whatever you want

Will only activate if an armored vehicle is in the trigger.  If you'll notice, a vehicle doesn't actually have to touch the mine to set it off, only get close.

Unnamed

  • Guest
Re:Problems with script- probably simple!
« Reply #10 on: 18 Jan 2004, 09:53:31 »
The variable _mine will be set to null once it explodes, so IsNull(_Mine) should do the job.
« Last Edit: 18 Jan 2004, 09:53:55 by Unnamed »

Offline Chris Death

  • Former Staff
  • ****
  • Finally Death's gonna get ya
    • OFPEC
Re:Problems with script- probably simple!
« Reply #11 on: 19 Jan 2004, 06:12:40 »
And just for info:

the script would also not work if you could getdammage a mine.

You assign _dammage = getdammage _mine only once before
the loop starts. Therefore _dammage will never change anymore during the loop.

~S~ CD
Dont argue with idiots....they will bring you down to their level and beat you there with experience.

How to use Waypoint type Scripted

Offline Skumball

  • Members
  • *
Re:Problems with script- probably simple!
« Reply #12 on: 19 Jan 2004, 09:33:29 »
As the man above says:

_mine = _this select 0
#al
_damage = (getdammage _mine)
~0.001
? _damage == 0 : goto "al"
setacctime 0.05

I modified the script slightly (spelling, delay time - think 0.001 is small enough). I couldn't say if it works so try it out  :P

Offline icarus_uk

  • Members
  • *
  • LiarLiarPants Inflame True
    • [furryclan]
Re:Problems with script- probably simple!
« Reply #13 on: 19 Jan 2004, 14:23:45 »
I already tried that and said why it doesnt work.  Also the loop is a terrible way of doing that when you could just as easily use the @ to make the script wait.