Home   Help Search Login Register  

Author Topic: need help with loop  (Read 642 times)

0 Members and 1 Guest are viewing this topic.

typhoon123

  • Guest
need help with loop
« on: 05 Sep 2005, 12:38:07 »
Could someone please explain to me how #loop works here is my script
Quote
_camera = "camera" camcreate [0,0,0]
_camera cameraeffect ["internal","back"]
_camera settarget a1
_camera setrelpos [6,6,6]
_camera camcommit 0
what i am wanting to do is get that camera to stay at that position while he is running how would i do that :) any help is appreciated
« Last Edit: 05 Sep 2005, 12:48:50 by typhoon123 »

Offline 456820

  • Contributing Member
  • **
Re:need help with loop
« Reply #1 on: 05 Sep 2005, 13:09:12 »
#loop is not a dommand it is just a bookmark for example but it is commonly used in loops i dont know why
the '#' creates a bookmark so you can go to that point using the command goto "name of bookmark here" when using goto do not put the # in the brackets

okay but anyway on to your question

Quote
_camera = "camera" camcreate [0,0,0]
_camera cameraeffect ["internal","back"]

#loop start
_camera settarget a1
_camera setrelpos [6,6,6]
_camera camcommit 0
~0.0
? moveon : goto "next" else goto "loop start"

#next
; here you can place the rest of your camera script

as you can see that will refresh the camera every 0.0 seconds you can change it to what you want 0.0 works best but can cause lag
when moveon = true it will carry on with the script if you want you can change the condition moveon to suit your needs i usually actiavate the condition for the script to carry on using a trigger or a waypoint

hope this helps
also syntax for above i am 100% sure its correct

Offline MrN

  • Contributing Member
  • **
  • Pffff
Re:need help with loop
« Reply #2 on: 05 Sep 2005, 13:12:14 »
Rather than doing it yourself, search for Snypir's vehiclecam script in the Editor's depot.  :)

If you have a look in that script you also might be able to work loops out.  ;)
In the 60's, people took acid to make the world weird. Now the world is weird and people take Prozac to make it normal.

typhoon123

  • Guest
Re:need help with loop
« Reply #3 on: 05 Sep 2005, 13:16:44 »
thanks a lot it is much appreciated i can now create the part of my cutscene ive been trying to create for days ;D

typhoon123

  • Guest
Re:need help with loop
« Reply #4 on: 05 Sep 2005, 13:22:33 »
oh ps i also would like to know how to quit the loop after its started going

Offline 456820

  • Contributing Member
  • **
Re:need help with loop
« Reply #5 on: 05 Sep 2005, 13:24:00 »
i said above with a condition when that condition is true it will go to the next part of the script in my example i used 'moveon'

typhoon123

  • Guest
Re:need help with loop
« Reply #6 on: 05 Sep 2005, 13:25:42 »
 ;D ;D ;D ;Dthanks ill give it a try  ;D ;D