Home   Help Search Login Register  

Author Topic: problem with script  (Read 594 times)

0 Members and 1 Guest are viewing this topic.

ThEoNeAnDoNlY

  • Guest
problem with script
« on: 26 Feb 2005, 14:25:20 »


hello, im running this script.

Quote
player playmove "Combattomedic"

~5

sandbag setpos [(getpos player select 0)+0,(getpos player select 0)+4,0]

~3

exit

but when the script is activate the sandbag dsnt appear infrontof me, instead it dissapears!!!!!!

Guy

Offline THobson

  • OFPEC Patron
  • Former Staff
  • ****
Re:problem with script
« Reply #1 on: 26 Feb 2005, 14:27:18 »
Your second select 0 should be select 1

That will then place the sandbag 4 m to the north of the player's posisiton.

ThEoNeAnDoNlY

  • Guest
Re:problem with script
« Reply #2 on: 26 Feb 2005, 15:36:38 »
ok, with that sorted how do i set the FOV of the sandbag?

Guy

ThEoNeAnDoNlY

  • Guest
Re:problem with script
« Reply #3 on: 26 Feb 2005, 15:40:59 »
ok change that, how do i get it so it is infront of me, instead it is always to the north of the player, how do i get it to be set infront of me no matter where i am looking.

guy

ThEoNeAnDoNlY

  • Guest
Re:problem with script
« Reply #4 on: 26 Feb 2005, 15:53:31 »
ok ok ok, im using my old script

Quote
~3
_dir = getDir player
_pos = getPos player

; optional direction change of 'bang'
bang setDir _dir

; place infront of the player
bang setPos [(_pos select 0)+(sin _dir), (_pos select 1)+(cos _dir), 0]
~3

but when i do that the sandbag appears at my feet and so the player gets abit stuck, so how do the then add to it to place it 4 ft infront of me

Guy

Offline THobson

  • OFPEC Patron
  • Former Staff
  • ****
Re:problem with script
« Reply #5 on: 26 Feb 2005, 16:33:16 »
_dist = 2.5

bang setPos [(_pos select 0)+_dist*(sin _dir), (_pos select 1)+_dist*(cos _dir), 0]
« Last Edit: 26 Feb 2005, 16:33:35 by THobson »

ThEoNeAnDoNlY

  • Guest
Re:problem with script
« Reply #6 on: 26 Feb 2005, 17:02:58 »
ok put that and it says:

sandbag setPos [(_pos select 0)+(sin _dir), (_pos select 1)+_dist|#|(cos _dir), 0]

unknown operator

Guy
« Last Edit: 26 Feb 2005, 17:07:47 by ThEoNeAnDoNlY »

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re:problem with script
« Reply #7 on: 26 Feb 2005, 17:08:55 »
Have you initialised the variable _dist anywhere?


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

ThEoNeAnDoNlY

  • Guest
Re:problem with script
« Reply #8 on: 26 Feb 2005, 17:09:47 »
oh no it works now, i forgot to put the > * <

btw what does * mean???

Guy

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re:problem with script
« Reply #9 on: 26 Feb 2005, 17:26:24 »
'*' means ........multiply

So 2*2 would mean 2 multiplied by 2



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

ThEoNeAnDoNlY

  • Guest
Re:problem with script
« Reply #10 on: 27 Feb 2005, 14:02:20 »
ahh cheers planck, btw does anyone here know how to speed up a;

Quote
(count units gr1 == 0) && (count units gr2 == 0)

script? when i put something liekt hat it always takes ages to trigger, so when i clear out a village for example, i am waiting about5  mins until the game realises everyone is dead.

Guy

Offline Sui

  • Former Staff
  • ****
    • OFPEC
Re:problem with script
« Reply #11 on: 28 Feb 2005, 04:41:14 »
That's because the count command relies on the leader knowing about the unit being dead.
Like when you're playing and you get all the "Oh no, 3 is down" radio messages.
Sometimes it takes a while to trigger.

Try this instead:

(West countside units gr1 == 0) and (West countside units gr2 == 0)

Obviously if the side of the units isn't west then change that to east or resistance ;)