Editors Depot - Mission Editing and Scripting > OFP - Editing/Scripting Multiplayer

[Question]Making a bind key to a known script

<< < (2/3) > >>

RKurtzDmitriyev:

--- Quote ---I have seen a lot of games that has this function and I encountered enough players with functions very similar to what I'm asking for WITHOUT  being called or accused as cheaters.

--- End quote ---

Well, like I said, it all depends on context. Just use discretion.  :P


--- Quote ---Yes.. I am asking for a way to do that without tampering with the missions myself (that will be cheating, wont it?)
--- End quote ---

Well, "tampering" as in hacking into the missions after they've been sent out to players would definitely be cheating.

What I was saying is that I'm pretty sure I know of a way to design a mission that would have this feature, but unfortunately it looks as though that's not what you're looking for. :(

Good luck. :good:

Lone~Wolf:
Woah Woah, slow down.

Unless you're strapped for space, then I don't see why you couldn't just use the radio stuff. 0-0-1 etc.

But I don't think you understood my first post correctly. There should be no problem in executing that script for each player. If the problem arises that you do not know what units will need to execute the script, then create a trigger that engulfs the whole map and put it for anyone to activate. Then put in the execution line the words "_x exec {keyscript.sqs}" forEach thisList. Then change the script so that it says:
--- Code: ---_p = _this select 0
@(_p == player)
#LOOP
_x = 0
~1
@(_p == player)
_x = call loadfile ":input getkey X"
? _x = 1 : [_p] exec "thescript.sqs"
goto "LOOP"
--- End code ---

If that's too much hassle, then why don't you just exec the script for each player via (player exec "keyscript.sqs") in the init.

MadBafla:
Thank you RKurtzDmitriyev
And about what you said, lonewolf, the problem with the methods you gave me, I understand them, but if you'll read 2 messages above if I'm not mistaken, you'll meet this:

--- Quote from: MadBafla on 05 Jun 2010, 16:18:53 ---...
But to the point:
Yes.. I am asking for a way to do that without tampering with the missions myself (that will be cheating, wont it?) and I am not thinking about making my own mission because my knowledge in scripting etc. is very low.

--- End quote ---

I'm not building a mission because when I tried I saw there are a lot of scripts I don't know and don't have time to learn so I just decided to live with what's on.
I want to make key-binded chat messages. I thought about the Custom radio messages, but the problem is I can't use certain charecters such as "*" or ' for instance and that's a bit of a trouble.
The point is I need to run the file with no regard to the mission and I wish it was key-binded.

Is there any way to do that?

Thanks again
MadBafla :cool2:

h-:
Can't remember how flexible OFP eventhandlers are (haven't touched OFP editing in years) but it might be possible to create an addon that uses fWatch and adds a init event for example for all man class units that then executes that fWatch loop mentioned earlier. Done like this any mission using soldiers will activate the addon.

This way you don't have to edit the missions themselves but if you're not capable of mission editing I think coding an addon is not really a possibility since it's generally be far more complex (creating a mission doesn't necessarily require one single script btw). :dunno:

Lone~Wolf:
Don't forget that all scripts placed in a folder named "Scripts" in the OFP directory are universal to all missions on the computer. Therefore you could make the necessary script and put it there so you don't have to spend time uploading it for every mission.

I once considered making an OFPR MP mission which exploited that for a sort of show-me-yer-moves sort of thing, where everyone came up with their own superpowers or whatever and simply named a script to execute their powers in their script folder as "INIT_PLAYER_POWERS.sqs". Because each computer could not find the necessary script in the mission folder, it grabbed the LOCAL file from Scripts. This allowed different files, each on the local computers to run. I tested this out with a bunch of computers and it does work!

Fun, innit?  ;)

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version