Home   Help Search Login Register  

Author Topic: 1st script  (Read 1053 times)

0 Members and 1 Guest are viewing this topic.

titan

  • Guest
1st script
« on: 06 Apr 2003, 21:35:50 »
this is what is in my first script...

_nade = camcreate getmarkerpos "1"
_nade = camcreate getmarkerpos "1_1"
_nade = camcreate getmarkerpos "1_2"
_nade = camcreate getmarkerpos "1_3"
_nade = camcreate getmarkerpos "1_4"
_nade = camcreate getmarkerpos "1_5"
_nade = camcreate getmarkerpos "1_6"
_nade = camcreate getmarkerpos "1_7"
_nade = camcreate getmarkerpos "1_8"
_nade = camcreate getmarkerpos "1_9"


basically im trying to get it to find a marker called 1, 1_1, 1_2 etc. and then create a grenade there. wat i put in a trigger is   Radio Alpha, On Activation: []exec "nade.sqs".

when i go into the game and click on the radio i get a error message saying  

'_nade = camcreate |#|getmarkerpos "1_9"':Error Unknown operator getmarkerpos

is there smething missing from my script or is smething wrong, any ideas??

Offline Igor Drukov

  • Contributing Member
  • **
  • Conscientious Subjector
Re:1st script
« Reply #1 on: 06 Apr 2003, 21:48:22 »
Provided your markers all exist, just do this :
_nade="grenade" camcreate getmarkerpos mymarker
What you need is the string of the object you want to create...
This will make a grenade explode at the markers poisitions, hope that's what you want...
(Note : I haven't tried your script, but there might be something wrong with the fact that all your grenades have the same name at the same time ; maybe you should add a one-second delay : ~1 between each line).

titan

  • Guest
Re:1st script
« Reply #2 on: 06 Apr 2003, 22:26:43 »
ok, here is the new version...

_nade = camcreate getmarkerpos nade1
~1
_nade = camcreate getmarkerpos nade1_1
~1
_nade = camcreate getmarkerpos nade1_2
~1
_nade = camcreate getmarkerpos nade1_3
~1
_nade = camcreate getmarkerpos nade1_4
~1
_nade = camcreate getmarkerpos nade1_5
~1
_nade = camcreate getmarkerpos nade1_6
~1
_nade = camcreate getmarkerpos nade1_7
~1
_nade = camcreate getmarkerpos nade1_8
~1
_nade = camcreate getmarkerpos nade1_9

Exit


but i still get the same error message as before, im mainly noteing the part where it says ":Error Unknown operator getmarkerpos" because it says that it doesnt regonise the getmarkerpos part. I dont know why as i can put in in a trigger! so if i cldnt use GetMarkerPos to pick up a marker, what other command cld i use. Because if i just put GetPos then it wont look for a marker!

Offline Igor Drukov

  • Contributing Member
  • **
  • Conscientious Subjector
Re:1st script
« Reply #3 on: 06 Apr 2003, 22:45:54 »
No. This :
_nade = "grenade" camcreate getmarkerpos nade1
~1
_nade = "grenade" camcreate getmarkerpos nade1_1
~1
_nade = "grenade" camcreate getmarkerpos nade1_2
~1
_nade = "grenade" camcreate getmarkerpos nade1_3
~1
_nade = "grenade" camcreate getmarkerpos nade1_4
~1
_nade = "grenade" camcreate getmarkerpos nade1_5
~1
_nade = "grenade" camcreate getmarkerpos nade1_6
~1
_nade = "grenade" camcreate getmarkerpos nade1_7
~1
_nade = "grenade" camcreate getmarkerpos nade1_8
~1
_nade = "grenade" camcreate getmarkerpos nade1_9
should work. It will create a sort of salvo effect, with grenades exploding at the different markers positions, with a one-second interval...
Eeer... Your markers DO exist, don't they ? And with the name you've given them in the script (sorry for asking, but we all sometimes make unclever mistakes...)


titan

  • Guest
Re:1st script
« Reply #4 on: 06 Apr 2003, 23:00:08 »
2 things, 1) HOW THE HELL CLD I NOT NOTICE THERE WERE NO GRENADES IN THE SCRIPT....GRRRRRRRRRR!!!!!

2) Yeah, in this case the markers will alrdy be there, as this is my 1st script im doing simple stuff, but i also wld like to know how to make so that you can put down the markers during a mission (wldnt heppen to know wld you?)

anywho, i will give it a test now...thx!

Offline Igor Drukov

  • Contributing Member
  • **
  • Conscientious Subjector
Re:1st script
« Reply #5 on: 06 Apr 2003, 23:05:47 »
All right, you can change the position of your markers by using the following command :
mymarker setmarkerpos "format position", where format position looks like this : [x,y,z] (in the case of markers, z is optional) or like this : getpos myobject.
Put the markers somewhere on the map (to know how to hide or show them, there is a Tut ; you need to have an init.sqs file where you write "mymarker" setmarkertype "empty", etc.)
As it is your first script, I suggest that you use invisible Game Logic objects. In which case, your script will be :
_nade="grenade" camcreate getpos gamelogic1 etc;
And to change their positions :
gamelogic1 setpos [x,y,z]
« Last Edit: 06 Apr 2003, 23:11:44 by Igor Drukov »

titan

  • Guest
Re:1st script
« Reply #6 on: 06 Apr 2003, 23:06:36 »
you my friend are a genius...all good! Although i did have to change it from just nade1, nade1_2 etc too "nade1", "nade1_2" etc.

but what i am looking for now, is either a way of u putting a marker on the map then calling in the stirke via radio, or a single click on the map where you want the strike.


But thx anyway!

Offline Igor Drukov

  • Contributing Member
  • **
  • Conscientious Subjector
Re:1st script
« Reply #7 on: 06 Apr 2003, 23:16:05 »
onmapsingleclick {"mymarker" setmarkerpos _pos;false}
"mymarker" setmarkerpos getpos _pos
[] exec "myscript.sqs",
to be done for each marker.

titan

  • Guest
Re:1st script
« Reply #8 on: 06 Apr 2003, 23:21:22 »
cld you explain this command?!

Offline Igor Drukov

  • Contributing Member
  • **
  • Conscientious Subjector
Re:1st script
« Reply #9 on: 06 Apr 2003, 23:41:33 »
Well, the best way to learn is to learn from masters, isn't it ?
There are excellent scripts that do exactly what you want to do (check Doolittle's True Projectile Artillery, for instance). Open them, and see how they work  ;). And play with them  :D ! Hoped I helped.

titan

  • Guest
Re:1st script
« Reply #10 on: 07 Apr 2003, 00:33:33 »
cant find this script, where wld it be?