OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting Multiplayer => Topic started by: RDX on 26 Dec 2004, 01:46:28
-
Hi
I am making a multiplayer mission and want to disable a player from moving and do any action(not turning or shooting) for about 10s after he has executed an action. Has somebody a tip for how I can accomplish this?
-
disableuserinput true
then
disableuserinput false
-
with that command you will freeze the player, however I want the player to still be able to turn around and shoot.
-
try using a script:
exec this with the action:put this in your action script at the beginning
[_this select 0] exec "holdpos.sqs"
_unit = _this select 0
_pos = getpos _unit
_timer = 10
_clock = 0
#loop
?_clock >= _timer:exit
_unit setpos _pos
~.1
_clock = _clock + .1
goto "loop"
hope you know what i mean :P
-
Thanks for the help, I could get it to work is I used ~1 wait. When I used ~0.1 the player couldn't turn.
However now I have a new problem, I thought I had it worked out yesterday, but I forgot to save the mission so I lost everything :-\. And now I can't get it to work.
I have a trigger that should activate an action to the player inside the trigger, I uses the following statement at the trigger.
On Activation: action = Player AddAction ["Call AirStrike", "Strike.sqs"]
On Deactivation: Player removeaction action
The problem is how to point to the player that activates the trigger. If I use "this" instead it doesn't work. And if I name the player Player it woks but I want it to work for everyone that enter the trigger. I can't tie the action to an object because "this" must point to the player in the script Strike.sqs
-
I can't tie the action to an object because "this" must point to the player in the script Strike.sqs
not quite.
when you have an action, 3 things are passed to the script:
_this select 0 :what it is tied to
_this select 1 :who activated it
_this select 2 :action id
so in your script you define the unit by using:
_unit = _this select 1
-
It's quite embarrassing when I wrote the above post I didn't know that there was a "player" syntax so I solved the problem without knowing it myself. (it worked with my code above)
..as I solve a problem I discover another one, is there a way to make a static building unable to get destroyed? I want the two high towers at province to withstand everything you can throw at them.
I have tested an idea with triggers.
Condition: getdammage (nearestbuilding trigger)>0.1
On Activation: (nearestbuilding trigger) setdammage 0
But it doesn't work, I don't know if "nearestbuilding" can take a trigger as an argument. Perhaps you could use the object(house) ID?
Can someone make buildings invincible?
Ps. Thanks Triggerhappy if I had known that I would have saved a lot of time.
-
I found a solution to the invincible House :D
I put the line "(object 20913) setdammage 0" in a time script.
-
no prob
as for your question:
just use the object id
(object XXXX) setdammage 0
XXXX stands for the id
just use that command in a loop or something similar (conditional code)
oops too late :P
-
Hi
In my mission I have the multiplayer S1-S14, is there a way to find out who is entering a trigger? The trigger should set 14 different variables according to who is entering the trigger.
-
i think you would need a script to check because triggers can't have multiple activation lines.
or you could have 14 triggers, each checking for its respective player
if you use the script, it would be something like this:
Trigger: repeatedly
condition: whatever side present (should fit all players (thus, anybody would work fine)
activation:[thislist] exec "checkunit.sqs"
checkunit.sqs
_list = _this select 0
?s1 in _list:(varible change code here)
?s2 in _list:(varible change code here)
etc
-
Hi, now my mission has become ready to start testing it on a server. But it won't work on a server. I have saved it as usermisson and then copied all the script and files in to the map. And then packed it with make PBO v1.1. It works fine when I host it on local LAN, but when I upload it to the server, it just blink, when you choose the mission, and you are back at choosing missions.
I have heard that it could be a problem with the addons. But I have just added standard RES.
There are some not standard RES vehicle list but they were in the mission that I started to edit from. I have also heard that there should be a list of all addon in a file, but I can't find it.
Vehicle list:
UH60
OH58
AH64
Cobra
Kamov
Mi17
Mi24
A10LGB
A10
SU25
CESSNA
BMP2
BRADLEY
T55G
T72
M60
Vulcan
Zsu
T80
M1AbramsAuto
I have almost no idea what script/variables that should run on the server an on the client. But I was planning to test it to see what I should change. But maybe it won't run if there are some errors with the local/not local varibles.
Mission:
http://www.geocities.com/rdxgames/RDX_1.2m_gunship.zip (http://www.geocities.com/rdxgames/RDX_1.2m_gunship.zip)
-
unpbo your mission and look in the mission.sqm file
the addons used will be right at the top
-
thx, this is the addons in the mission file
addOns[]=
{
"6G30",
"ah64",
"oh58",
"bmp2",
"bis_weaponpack",
"bis_resistance",
"vulcan",
"bradley",
"su25"
};
addOnsAuto[]=
{
"6G30",
"bis_resistance"
};
but as you can see in the previus post I am using more vehicle than is shown, should I add all of them?
-
anything from the original game doesn't need to be added, and you don't just add the names anyway, those are all names of pbo files in your (res) addons folder
i don't really know what the problem is that you're having, though. so i don't know how to help you. (something with your addons it seems?)
sorry
-
I have noticed that the problem is when I unpack or pack the mission.
I have unpacked a working mission with "pbo_decryptor15", However I when I check the logg I can see a few checksum errors:
"File: Ammunition.sqs Compressed: YES
Extraction result: CHECKSUM Error! - file successfuly recovered"
I get checksum errors in every mission I unpack.
Then I pack it with StuffPBO/make PBO. I have used a different name when I packed the missions.
All with the same result, you can't choose the mission on a server. Is there a problem with any of my program?
-
maybe, i use unpbo and makepbo. they work fine for me
-
I have found the problem, The Linux server only accepted names with small letters. ::)