Jump to content
Sign in to follow this  
Owuor

My first script...I need a hand

Recommended Posts

I'm trying to make my first script and am having no luck. Let me describe the issue. I have a trigger which has activation none and is a switch. It's condition is not (alive sport) ..... it's on activation is [prototype,sport] exec "throttle.sqs"

sport and prototype are the name of vehicles and the script of some camera action is supposed to start when sport gets destroyed...

here is the script...

bcam = "seagull" camcreate [0,0,0]

bcam cameraeffect ["internal", "back"]

bcam camsetpos [setPos prototype]

bcam camsettarget sport

bcam camsetrelpos [5,10,2]

bcam camcommit 0

titlecut [" ","BLACK IN",2]

bcam camsetrelpos [10,15,4]

bcam camcommit 4

@CamCommited bcam

~2

Sometimes, nothing happens with the trigger other than the Text i have set up in the effects...other times I get the error "Script throttle.sqs not found" Btw, I am in preview mode in the mission editor if that makes any difference.

THanks!

Sidenote: How do i find the coordinates in x,y,z format of a given position on the map?

Share this post


Link to post
Share on other sites

From the top of my head I would say , use activation game logic, or Anybody when you use a trigger that is over a unit so that it activates immediately when condition "alive sports" becomes true.

Then, also make sure you got explorer to display extensions, that sometimes messes up things with scripts. (go to explorer, tools menu > folder options > view tab, and then set to display extensions of known file types)

These should do the trick, but if you need further help, you could try my faq which has some practical help concerning scripts.

About the x,y,z problem, you can get coordinates by trying the following...

Create a tank, name it tank

then in a script do this command :

mytankpos = getpos tank

now, the variable mytankpos will contain the x,y,z position of the tank. To display the coordinates try this command :

hint format ["Tank is at : %1",mytankpos]

-

Don't forget the www.ofpeditingcenter.com , has lots of tutorials !

Share this post


Link to post
Share on other sites

Yes! You were right on the money about my file extension...there was a hidden .txt at the end. Now the trigger is activating the script.

But...I now get this error:

'CamCommited |#bcam':Error Unknown Operator bcam

I dont know what to change in the script to fix this and have tried toying with the GetPos thing you mentioned.

I want my script to show the smoldering wreckage of a car when it is destroyed. The car may be anywhere withing like a 300 yard radius. That is what i'm trying to achieve.

Side question: If a vehicle/player is dead...is the name I gave it still valid as a reference?

Share this post


Link to post
Share on other sites

Correct me if I'm wrong, but I'm quite sure if a vehicle is destroyed before trying to name it as a target for a camera.  The camera will spit out an error.

I learned that after scripting an action scene in a demo mission I have just almost finished.  The mission I am using it in is being published here in the forum just to test the quality of the mission, I can always add the end triggers later.  I am putting the final version of the demo mission out for download very soon.

Here's the site for my mission if you wanna see how simple camera scripting works well if you know how.  Its in pbo format, so I can't let you look at the scripting source code.

This mission uses the first script I have ever made with great success.  No joke, and I don't know much about scripting.

Basic Camera Scripting

Share this post


Link to post
Share on other sites

</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Quote (Owuor @ Feb. 14 2002,20:34)</td></tr><tr><td id="QUOTE">...

bcam camsetpos [setPos prototype]

...<span id='postcolor'>

I see you have a typo here. Should this not be GetPos prototype?

If you have that error in your actual script........

Share this post


Link to post
Share on other sites

You are right Conan, I did have a typo.

I started from scratch and this is what I have so far:

bcam = "seagull" camcreate [4714.98,11040.5,0]

bcam cameraeffect ["internal", "back"]

ab=GetPos sport

bcam camsetpos ab

Another thing that was screwing me up before was I kept trying to do this: bcam camsetpos [ab], not realizing I was confusing it into thinking I had an array when I didn't. I'm going to keep adding to it line by line until I get the effect I want.

This scripting is frustrating as hell, but addictive!

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×