Home   Help Search Login Register  

Author Topic: Quick Question, script command trigger  (Read 1984 times)

0 Members and 1 Guest are viewing this topic.

Offline X75TIGER75X

  • Members
  • *
Quick Question, script command trigger
« on: 08 Oct 2008, 00:39:00 »
I don't know if this is answered, but I can't seem find it.

I'm trying to make waypoints connected with trigger to make heli stop and wait until told to. I want to set up camera scripted so helicopters stop and wait until script executes the trigger that will tell helicopter to continue. But I can't find that script

is it 'exec'

or stuff I don't know.

thanks to anyone who answered

-x75tiger75x

Offline Odin

  • Members
  • *
Re: Quick Question, script command trigger
« Reply #1 on: 08 Oct 2008, 08:18:05 »
G'day you could try this method,
name your helicopter
helo1 

open the wp where you want it to stop and type this in the onAct box
dostop helo1

when you want it to fly again, In either your tigger's onAct, or your camera script add this line
helo1 doFollow helo1

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: Quick Question, script command trigger
« Reply #2 on: 08 Oct 2008, 11:31:09 »
With "stop" do you mean landed and waiting?

Offline X75TIGER75X

  • Members
  • *
Another Question
« Reply #3 on: 08 Oct 2008, 21:33:33 »
No, just hovering and wait.

Odin's method helped

Okay, another question I'll post here than making whole new thread, Again, I cannot find this in Editor Guide or internet, how do you teleport object?

I had in my mission is C130 flying, after the game is done executing camera script I need from script call C130 to move xyz location and direction so I can make another camera script.

I hope that's clear enough for you.
« Last Edit: 09 Oct 2008, 05:35:57 by X75TIGER75X »

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: Quick Question, script command trigger
« Reply #4 on: 09 Oct 2008, 18:33:27 »
This script moves an existing plane to indicated position and makes it to keep indicated direction for 4Km.
Code: [Select]
_plane = _this select 0;
_pos = _this select 1;
_dir = _this select 2;

_speed = (speed _plane)/3.6;
_plane setDir _dir;
_plane setPos _pos;
_plane setVelocity [_speed*sin(_dir),_speed*cos(_dir), 0];
_plane doMove [(_pos select 0)+sin(_dir)*4000,(_pos select 1)+cos(_dir)*4000];

Offline X75TIGER75X

  • Members
  • *
Re: Quick Question, script command trigger
« Reply #5 on: 10 Oct 2008, 03:28:26 »
Mandoble, Thanks for script but sorry, I'm not sure how to use it. Where do you put coords, unit string, etc?


#EDIT: Removed the unnecessary quote. No need to quote the entire previous post you're replying to.    h-
« Last Edit: 10 Oct 2008, 08:20:25 by h- »

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: Quick Question, script command trigger
« Reply #6 on: 10 Oct 2008, 08:31:07 »
Code: [Select]
_plane = _this select 0; // <-- The plane to move
_pos = _this select 1; // <-- Coords, the position
_dir = _this select 2; // <-- the direction the plane will maintain

.... // <- Rest of the script.

my_plane moving to position of marker named mk_cam2 and then moving West for 4Km.
Code: [Select]
res = [my_plane, getMarkerPos "mk_cam2", 270]execVM"scriptname.sqf";

Offline X75TIGER75X

  • Members
  • *
Re: Quick Question, script command trigger
« Reply #7 on: 10 Oct 2008, 22:22:15 »

I'm sorry if I kinda annoying you, Mandoble, but I still got it wrong, It wasn't working in my mission.
I'm still pretty beginner. I tried my best to learn what you're trying to explain.

What I did, I put first part of code in the script but I named it to "T.sqf", I did nothing to the script

then I set marker :teleporttest1 on both fields on the map.

I named my plane Test

finally I put trigger that says res = [test, getMarkerPos "testmarker1", 270]execVM "t.sqf";

and set it as radio command. no error message showed up but it didnt teleport.

Just saying it again, I want a script that INSTANTLY move object with name to location. To TELEPORT. And set it on direction, speed. That's what I wanted.

UPDATE: I tried put res = [my_plane, getMarkerPos "mk_cam2", 270]execVM"scriptname.sqf"; one into script and called it from trigger again, didnt work.

« Last Edit: 10 Oct 2008, 22:29:40 by X75TIGER75X »

Offline hoz

  • OFPEC Site
  • Administrator
  • *****
Re: Quick Question, script command trigger
« Reply #8 on: 11 Oct 2008, 06:11:50 »
I followed mandobles instructions  and attached an demo mission which works perfectly. Takes a sec to spot the camel.
« Last Edit: 11 Oct 2008, 06:27:54 by hoz »
Xbox Rocks

Offline X75TIGER75X

  • Members
  • *
Re: Quick Question, script command trigger
« Reply #9 on: 11 Oct 2008, 19:33:36 »
Hmm, I'll download your file and try it.

UPDATE: Your worked. I'll try redo it again.

UPDATE1: Weird, sometimes it work, sometimes it don't. (Inconsistently) and If you tried to teleport AI, the AI will turn back to and fly to his previous location before he was teleported then fly back to his waypoint.
« Last Edit: 11 Oct 2008, 20:11:17 by X75TIGER75X »

Offline X75TIGER75X

  • Members
  • *
Re: Quick Question, script command trigger
« Reply #10 on: 31 Oct 2008, 22:34:28 »
Sorry for bumping this almost-month old thread but I forgot to say thanks Mando and others. I finally got it work.  :D