Home   Help Search Login Register  

Author Topic: basics of teleport and onMapSingleClick... (solved)  (Read 10510 times)

0 Members and 1 Guest are viewing this topic.

Offline loki72

  • Former Staff
  • ****
    • Loki's Nightmare
basics of teleport and onMapSingleClick... (solved)
« on: 31 May 2008, 09:54:26 »
greetings,
i am sure i could not be more vague.. however... ???

if i am in one spot, and i want to hit 'M' and click on the map to teleport to another area.. how would i?

if i had an addaction;

Code: [Select]
player addAction ["gotoA","scripts\tele.sqf"];
how does the onMapSingleClick connect to the addAction?

thanks
« Last Edit: 31 May 2008, 15:21:05 by loki72 »

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: basics of teleport and onMapSingleClick...
« Reply #1 on: 31 May 2008, 10:47:53 »
 :blink:
You simply put the onMapSingleClick command inside the action script tele.sqf and a title text asking for map click.
Code: [Select]
// tele.sqf
titleText["Select Map Position", "PLAIN"];
onMapSingleClick "vehicle player setPos _pos; onMapSingleClick '';true;";

Note that onMapSingleClick ''; is with two single quotes.

Offline loki72

  • Former Staff
  • ****
    • Loki's Nightmare
Re: basics of teleport and onMapSingleClick...
« Reply #2 on: 31 May 2008, 15:20:36 »
 :D

i laughed for 5 minutes... i had only wished it was that simple.. thank you.

Offline Rommel92

  • Members
  • *
Re: basics of teleport and onMapSingleClick... (solved)
« Reply #3 on: 01 Jun 2008, 03:45:19 »
Mandoble, is there any way to check for the "shift" inside the
Code: [Select]
titleText["Select Map Position", "PLAIN"];
onMapSingleClick "vehicle player setPos _pos; onMapSingleClick '';true;";

Perhaps:
titleText["Shift-Click Map Position", "PLAIN"];
onMapSingleClick "If (_shift) then {vehicle player setPos _pos; onMapSingleClick ''};;true;";


Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: basics of teleport and onMapSingleClick... (solved)
« Reply #4 on: 01 Jun 2008, 10:44:49 »
You may check for shift and alt states.

Offline Rommel92

  • Members
  • *
Re: basics of teleport and onMapSingleClick... (solved)
« Reply #5 on: 01 Jun 2008, 12:27:14 »
I don't think you understood the question I was asking, I meant is it possible within the scope of the OnMapSingleClick string/script to be executed, ie within the " ". Rather then launching another script to check for the states of _shift or _alt. Check the script I posted as a possibility, not sure whether it works, and am not unto the liberty to test it at this moment in time.