Home   Help Search Login Register  

Author Topic: Command for opening up the map? [SOLVED]  (Read 1455 times)

0 Members and 1 Guest are viewing this topic.

Offline Krieg

  • Mission Maker
  • Members
  • *
  • Who dares wins.
Command for opening up the map? [SOLVED]
« on: 04 Jan 2010, 08:19:10 »
First of all, I did search both "OFP - Editing/Scripting General" and COMREF for command that could do that. Closest thing I found was "forceMap" which works, but you can't interact with the map, instead you can only shoot blind. I am starting to believe that there is no command that is designed to open interactive map up. If that's the case, then is there a way to work around this?

Thanks,
Krieg
« Last Edit: 31 Jan 2010, 20:46:00 by Krieg »
If you see a light at the end of the tunnel, then it's probably an enemy tank.

Offline bedges

  • Administrator
  • *****
    • OFPEC The Editing Center
Re: Command for opening up the map?
« Reply #1 on: 04 Jan 2010, 11:38:10 »
It would help if you gave a better description of what it is you're trying to do.

Offline Krieg

  • Mission Maker
  • Members
  • *
  • Who dares wins.
Re: Command for opening up the map?
« Reply #2 on: 04 Jan 2010, 12:04:23 »
Sorry for being non-understandable.

I had created a simple dialog-based command & control system that has a "move" command in it (besides other commands). What I am trying to do is that when I press "move" button it opens up the map so player can order other friendly group to move around (move script is based  of "OnMapSingleClick" command) using alt-shift-single-click (that is not the problem, though I scripted it). I am having problems in opening the map up. I tried forceMap command, but all you can do is shoot your gun while seeing non-interactive map. So my question is, is there any command that opens the map up.

Also, another, you've guessed it, scripting question. How to close a script that has "OnMapSingleClick" command in it? I've tried with global variables, but it did not work.
Code: [Select]
_clickclicked = 0
closeDialog 1

#check
onMapSingleClick {redwolf move _pos; leader redwolf sidechat "Roger. Moving out!"; _clickclicked = _clickclicked + 1}
?(_clickclicked == 1) : goto "exitpart"
goto "check"

#exitpart
exit
I do not want player to be able to issue move orders to the group forever while only clicking "move" in dialog once.
Any suggestions?

Thanks,
Krieg
If you see a light at the end of the tunnel, then it's probably an enemy tank.

Offline bedges

  • Administrator
  • *****
    • OFPEC The Editing Center
Re: Command for opening up the map?
« Reply #3 on: 04 Jan 2010, 12:44:47 »
As far as I remember, forcemap is used for map animations and it can't be interacted with while open - as you've discovered.

The alternative is to activate the onmapsingleclick when the Move button is clicked in the dialog, then close the dialog. The player must then open his/her map and click on it, activating the onmapsingleclick script. To remove the onmapsingleclick behaviour after the map has been clicked, simply put

Code: [Select]
onMapSingleClick {}
at the end of the script.

If you want a demo of how this works, download and play Sui's The Black Gap - it features exactly what you're trying to do.

Offline Krieg

  • Mission Maker
  • Members
  • *
  • Who dares wins.
Re: Command for opening up the map?
« Reply #4 on: 04 Jan 2010, 15:23:50 »
Thanks bedges!  :good:
If you see a light at the end of the tunnel, then it's probably an enemy tank.

Offline Krieg

  • Mission Maker
  • Members
  • *
  • Who dares wins.
Re: Command for opening up the map?
« Reply #5 on: 31 Jan 2010, 19:44:13 »
Hate to dig up an old thread, but there is a minor fault in my "move up" script.
As I said
Quote
I do not want player to be able to issue move orders to the group forever while only clicking "move" in dialog once.
I still did not achieve that.

Current version of the script:
Code: ("redwolfmove.sqs") [Select]
_click = 0
closeDialog 1

#check
onMapSingleClick {[_pos, _alt, _shift] exec "moveup.sqs"; _click = _click + 1}
?(_click == 1) : goto "exit"
~0.5
goto "check"

#exit
onMapSingleClick {}
exit

Thanks,
Krieg
If you see a light at the end of the tunnel, then it's probably an enemy tank.

Offline bedges

  • Administrator
  • *****
    • OFPEC The Editing Center
Re: Command for opening up the map?
« Reply #6 on: 31 Jan 2010, 20:14:24 »
Code: [Select]
onMapSingleClick {[_pos, _alt, _shift] exec "moveup.sqs"; onMapSingleClick{}}
« Last Edit: 31 Jan 2010, 20:25:27 by bedges »

Offline Krieg

  • Mission Maker
  • Members
  • *
  • Who dares wins.
Re: Command for opening up the map?
« Reply #7 on: 31 Jan 2010, 20:45:44 »
Extreme thanks on this, bedges! Works perfectly! :good:

Thanks,
Krieg
If you see a light at the end of the tunnel, then it's probably an enemy tank.