cobra@pulse 0 Posted June 28, 2006 Hello people. Righty then. I've got a MP mission, been working on it for some time now and im struglling with some of the scripts im trying to write for it. What am i struglling with? Well the following are what I am having trouble with: - onMapSingleClick : I am trying to script it so that once the player has the action he can click on the map to direct where a Resistance group will go to. Must be able to use in MP Thats really the only one i was struggling with, thinking about it now, lol. Any help would be great, cheers Share this post Link to post Share on other sites
AgentJonathan 0 Posted June 28, 2006 Okay, here it is. There is no script for it, choose a (some) unit(s) with a function key, go to your map, and simply click on the location you want them to go. Â If it dosen't work, Â thats messed up, cus it worked for me. Share this post Link to post Share on other sites
AgentJonathan 0 Posted June 28, 2006 Perhaps someone can help me too. I am making an FMV.sqs and I do not know how to make AI sit in a chair. Â Been struggling on this for some time now. Share this post Link to post Share on other sites
cobra@pulse 0 Posted June 28, 2006 Welcome to the forum mate. Firstly, I see that you may have misunderstood me. Your talking about using it in the mission, using F1 etc to move units. Im talking about advanced editing and scripting of moving units and AI around the map, believe me its not as simple as you may think. E.g. the script looks like that atm: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> ; Resgrp is a group ; gl_Resgrp is a gamelogic although I can't remember exactly what its for Resgrp sidechat "Black Eagle, stand by for movement orders." ~1 hint "Click on the position on the map where you want Black Eagle to go to" ~1 "Regrpmarker" SetMarkerType "Start"; "Resgrpmarker" setMarkerColor "ColorGreen" ? count units Resgrp == 0:goto "dead" leader Resgrp sideChat "Black Eagle standing by." a = 0 b = 0 onMap=false onMapSingleClick {Resgrp move _pos; leader Resgrp sidechat "Black Eagle Moving on"; gl_Resgrp setPos {a = (_pos select 0); b = (_pos select 1); clicked = true"publicVariable _x" forEach [a,b,onMapSingleClick]} @onMap onMapSingleClick {} _pos = [a,b] #dead [West, "HQ"] sideChat "We've got no contact with Black Eagle, I think they are all dead. Continue on with the mission. Out" EXIT As you can see. Not that simple but cheers for trying. With your problem, use the command: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">Unitname switchmove "FXSitHandsOnTable" To get the unit sitting at the table moving his hands every now and then. Good luck, and in the future mate, dont thread hyjack. Got a problem, search first then post in a new thread, not something that has no relivance at all to what you want to know. Anyone else help me? Share this post Link to post Share on other sites
AgentJonathan 0 Posted June 28, 2006 o sory mate. I may be able to help still tho. have you tried cycle waypoint? Share this post Link to post Share on other sites
AgentJonathan 0 Posted June 28, 2006 Another help question, does that code you gave me work without a table and only a chair, and does that code only work in a specific waypoint? Share this post Link to post Share on other sites
cobra@pulse 0 Posted June 28, 2006 Its an animation, and dont worry, it has nothing to do with way points. Open another thread mate and i'll help you or perhaps edit the one you already created. We are going way offtopic of what this ones supposed to be about. Share this post Link to post Share on other sites
AgentJonathan 0 Posted June 28, 2006 I am just not understanding the q, but I must shurely be more helpful. Share this post Link to post Share on other sites
mattxr 9 Posted June 28, 2006 i understand your question but i have no idea hows its done, i went into the on map single click business and never undertsood how it worked.. maybe sometime i will look into it when i have the time and see what wonders i can make.. lol "He wants a group to move to a position he selects when he clicks on the map" Share this post Link to post Share on other sites
cobra@pulse 0 Posted June 30, 2006 Any one got any ideas? Share this post Link to post Share on other sites
Wadmann 0 Posted June 30, 2006 Not an expert on the subject but I may be able to help some. A couple of things I noticed in your script. First of all, I did not see where you make onMap true so the script stops there (unless it is set to "True" elsewhere). <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">onMapSingleClick {Resgrp move _pos; leader Resgrp sidechat "Black Eagle Moving on"; gl_Resgrp setPos {a = (_pos select 0); b = (_pos select 1); clicked = true"publicVariable _x" forEach [a,b,onMapSingleClick]} I also noticed that there is not a ";" between clicked = true and "publicVariable _x" forEach [a,b,onMapSingleClick] but these are not your only issues. Where is the movement commands to make the group goto their destination? Below is code from a script that I use to move units to a marker. Works in MP but the darn markers do not move to the new position on each players screen. Never was able to fix that but look and see how this works. I did not make the script, only adapted two different scripts from the (old) OPEC site. <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">a=0 b=0 clicked = false onMapSingleClick {a = (_pos select 0); b = (_pos select 1); clicked = true; publicvariable "a"; publicvariable "b"; publicvariable "clicked"} Â @clicked onMapSingleClick {} _pos = [a,b] "Alphapoint" setMarkerPos _pos [Alphagroup,"Alphapoint"]exec "Goto.sqs" exit And the "goto.sqs": <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">group1=group (_this select 0) _marker=1 _marpos=_this select _marker units group1 commandmove getmarkerpos _marpos; Exit The original author used more lines of code than needed in the "goto.sqs" but I never bothered to clean it up as it worked well enought at the time. It should also work like this: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">group1=group (_this select 0) _marpos=_this select 1 units group1 commandmove getmarkerpos _marpos; Exit Hope that this helps you some. Wadmann Share this post Link to post Share on other sites
Metal Heart 0 Posted June 30, 2006 Doesn't it work if you just do something simple like: onmapsingleclick {resgroup move _pos; true} Share this post Link to post Share on other sites