Home   Help Search Login Register  

Author Topic: camCreate LaserGuidedBomb  (Read 625 times)

0 Members and 1 Guest are viewing this topic.

AnarCHy

  • Guest
camCreate LaserGuidedBomb
« on: 26 Jul 2004, 11:48:24 »
Hello.

I need help wit some code problems I have in a mission I am making.

I used a small part of script i found in the topic "Blowing Stuff Up!", from DBR_ONIX:
Quote
explo01 = "LaserGuidedBomb" camcreate [getpos crate select 0, getpos crate select 1, getpos crate select 2]

In this case, I have a trigger that goes off when "crates" gets destroyed.

But, whenever it calls for the code, I get an error message:
Quote
explo01 = "LaserGuidedBomb" camcreate [getpos crate select 0, getpos crate select 1, getpos crate select 2]; Error type Any, expected Number

Could someone tell me what is wrong here please?

thanks,
AnarCHy

CopyrightPhilly

  • Guest
Re:camCreate LaserGuidedBomb
« Reply #1 on: 26 Jul 2004, 11:52:27 »
if thats all one line then

Code: [Select]
explo01 = "LaserGuidedBomb"; camcreate [getpos crate select 0, getpos crate select 1, getpos crate select 2]
other wise look for where the # is in the error message and where ever that will be where the error is.

hope this helps

cheers, Philly

AnarCHy

  • Guest
Re:camCreate LaserGuidedBomb
« Reply #2 on: 26 Jul 2004, 11:59:42 »
Right after all of the code, after the last bracket is closed (])

That is where the problem is, but wtf?
Nevah used camCreate before...

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:camCreate LaserGuidedBomb
« Reply #3 on: 26 Jul 2004, 12:10:46 »
When you quote an error message always include the #.    Arguably its the most important bit.

In this case you talk about crates in your post but the code uses crate.    Also you seem to be trying to create something at the position of an object which doesn't exist because it's been destroyed.    

Make it work with a simple gamelogic for the position, before you try and insert it into your mission.    It's a common mistake this - using an unfamiliar piece of code in battle conditions before understanding it fully.   Always test a new command in a missionette first.    ;)
Plenty of reviewed ArmA missions for you to play

CopyrightPhilly

  • Guest
Re:camCreate LaserGuidedBomb
« Reply #4 on: 26 Jul 2004, 12:12:26 »
ok make your self a sqs file and put this in it:

Code: [Select]
_x=getpos crate select 0
_y=getpos crate select 1
_z=getpos crate select 2

explo01 = "LaserGuidedBomb" camcreate [_x,_y,_z]
exit;

then put this in the trggers activation:

Code: [Select]
[] exec "filename.sqs"
replacing filename with whatever u named the file.

i just tested this and it worked fine, i made a ammo crate and called it "crate" and then ran it, it worked

cheers, Philly
« Last Edit: 26 Jul 2004, 12:15:32 by CopyrightPhilly »

AnarCHy

  • Guest
Re:camCreate LaserGuidedBomb
« Reply #5 on: 26 Jul 2004, 12:39:59 »
thanks for your reply Philly, but Macca fixt it.  Thnx macguba and Philly for your help!

Now the munitions cache is gonna blow the base sky high!

Look for me mission later mebbe this next few days.


thnx again,

AnarCHy


*topic solved*