MP scripting Question(s), Adding Custom Action / Marker reveals |
MP scripting Question(s), Adding Custom Action / Marker reveals |
Jan 27 2009, 21:46
Post
#1
|
|
Member Group: Members Posts: 161 Joined: 7-September 07 Member No.: 1,086 |
I need help with a couple MP scripts
1) I am trying to create a script which gives the player to suicide, through an action menu selection. This will involve adding a custom action name (Suicide probably) and then followed by the player exploding [ I know how to do this part via create vehicle etc]. Basically I need to figure out how to add a custom action to the action menu then link this to the actually explosion/suicide snippet of script Also would such a script need JIP support? I assume not as the script will be run in the player's init line. 2) Another issue is that I plan to reveal markers to Blufor after they have killed a set number of Opfor, I know how to do this, but again am wondering if such markers would or would not be revealed to players just joining the match? |
|
|
Jan 28 2009, 02:25
Post
#2
|
|
Gee, I wish we had one of them doomsday machines. Group: Moderators Posts: 2,037 Joined: 13-November 06 From: Wales Member No.: 155 |
As far as JIP is concerned, I think all scripts are controlled server side. All you need to worry about is getting the scripts initialised on spawn/respawn.
You're buddies for the first script are addaction (http://community.bistudio.com/wiki/addAction) and camcreate (http://community.bistudio.com/wiki/camCreate). Using the camcreate command to spawn ammo (not magazines, but rather the shells themselves) will create a the explosion of that weapon. You can find the classnames of various munitions here (http://community.bistudio.com/wiki/ArmA:_Weapons). I'd advise using "Sh_120_HE", as it has a nice big blast radius, or "G_40mm_HE" for something smaller. The second issue is a lot easier. Create your markers as you would normally, take a note of their name. You can set the radius of a marker to 0 to hide it completely, then use the "setmarkersize" (http://community.bistudio.com/wiki/setMarkerSize) command to set to the desired size. Note that hiding a marker will not hide any text that may be attached to the marker. You can use "setmarkertext" (http://community.bistudio.com/wiki/setMarkerText) to change the text on the marker. Leave the string blank to have no text present ("" or " " will suffice) This post has been edited by D@V£: Jan 28 2009, 02:26 -------------------- The Rules - Nothing too complicated, follow these and we'll have no problems.
Moderation Feedback Thread - Tell everyone how much you Site Issues Thread - Complain about site issues here. We might even fix them! Community Chatter Thread - Furthest Mud-sling gets a free subscription to "JdB Monthly". QUOTE(Major Mike Shearer) We can categorically state that we have not released man-eating badgers into the area. QUOTE(Brace Belden) A machine gun is like a woman, I don’t understand it, I’m afraid of it, and one day I’ll accidentally be killed by one. |
|
|
Jan 28 2009, 21:04
Post
#3
|
|
Member Group: Members Posts: 161 Joined: 7-September 07 Member No.: 1,086 |
Cheers,
I have figured out how to make things work but now need more help. CODE _man = _this select 0; bomb1 = "Sh_122_HE" createvehicle getpos _man; deletevehicle _man; exit; This is the code I used for creating the suicide script, I was trying to figure out how to add a delay before the explosion. I was also wondering as I haven't properly play tested this yet if deletevehicle_man actually deletes the person who has used this action I used setmarkertype, setmarkercolor, and selectmarkertext for the second part but now am wondering if it possible to start the game with marker initially only shown to OPFOR? |
|
|
Jan 29 2009, 09:41
Post
#4
|
|
Gee, I wish we had one of them doomsday machines. Group: Moderators Posts: 2,037 Joined: 13-November 06 From: Wales Member No.: 155 |
I don't have much experience with deletevehicle...
Adding a delay is simple enough. If you're using .sqs use this command: CODE ~5 For a five second delay. If you're using .sqf... then you've clearly lost it! Use sqs for something like this. It'll save a lot of time and space. -------------------- The Rules - Nothing too complicated, follow these and we'll have no problems.
Moderation Feedback Thread - Tell everyone how much you Site Issues Thread - Complain about site issues here. We might even fix them! Community Chatter Thread - Furthest Mud-sling gets a free subscription to "JdB Monthly". QUOTE(Major Mike Shearer) We can categorically state that we have not released man-eating badgers into the area. QUOTE(Brace Belden) A machine gun is like a woman, I don’t understand it, I’m afraid of it, and one day I’ll accidentally be killed by one. |
|
|
Jan 29 2009, 22:49
Post
#5
|
|
Member Group: Members Posts: 161 Joined: 7-September 07 Member No.: 1,086 |
I have figured out most of my own problems but thanks again D@VE
However now the briefing/debriefing is not working right, and I am using Armaedit, yet it does not seem to hide Blufor/Opfor objectives correctly, any way to fix this? Also my debrief(s)/ending(s) are not working correctly either! |
|
|
Jan 30 2009, 05:22
Post
#6
|
|
Group: Addon Maker Posts: 1,148 Joined: 4-November 06 Member No.: 13 |
Can you paste the objectives part of the briefing.html here?
|
|
|
Jan 30 2009, 22:45
Post
#7
|
|
Member Group: Members Posts: 161 Joined: 7-September 07 Member No.: 1,086 |
CODE <!------------------------------------------------> <!-- Objectives - BLUFOR --> <!------------------------------------------------> <!-- Objective 1 --> <p><a name="OBJ_1"></a> <!-- [OBJ_1_BLUFOR] --> Destroy Weapon Caches <!-- [END] --> </p><hr> <!------------------------------------------------> <!-- Objectives - OPFOR --> <!------------------------------------------------> <!-- Objective 1 --> <p><a name="OBJ_2"></a> <!-- [OBJ_1_OPFOR] --> Remove the American Presence <!-- [END] --> </p><hr> Here are the endings CODE <!------------------------------------------------> <!-- Debriefing - BLUFOR --> <!------------------------------------------------> <!-- End #1 --> <h2><a name="debriefing:end1.west"></a><br> <!-- [TITLE_1_BLUFOR] --> Decisive Victory <!-- [END] --> </h2><br><p> <!-- [TEXT_1_BLUFOR] --> The insurgency has been squashed thanks to a lack of arms <!-- [END] --> </p><br><hr> <!-- End #2 --> <h2><a name="debriefing:end2.west"></a><br> <!-- [TITLE_2_BLUFOR] --> Defeat <!-- [END] --> </h2><br><p> <!-- [TEXT_2_BLUFOR] --> Our Rifle Company has been wiped out! <!-- [END] --> </p><br><hr> <!------------------------------------------------> <!-- Debriefing - OPFOR --> <!------------------------------------------------> <!-- End #1 --> <h2><a name="debriefing:end1.east"></a><br> <!-- [TITLE_1_OPFOR] --> Victory <!-- [END] --> </h2><br><p> <!-- [TEXT_1_OPFOR] --> It is a glorious day for our cause! <!-- [END] --> </p><br><hr> <!-- End #2 --> <h2><a name="debriefing:end2.east"></a><br> <!-- [TITLE_2_OPFOR] --> Defeat <!-- [END] --> </h2><br><p> <!-- [TEXT_2_OPFOR] --> We have failed. <!-- [END] --> </p><br><hr> Also I seem to lose the scripted action I made before, the suicide script when the unit respawns. I.e. when you start the game your unit if you are on OpFor has this in it's init line : CODE player addAction ["Explode", "bombcar.sqs"]; ideath = 0; this addEventHandler ["KILLED", {[] execVM "insurgencyintel.sqf"}] so I am not sure how to ensure that these things kick in each time the unit respawns
This post has been edited by communistbastard: Jan 30 2009, 22:48 |
|
|
Feb 1 2009, 06:25
Post
#8
|
|
Group: Addon Maker Posts: 1,148 Joined: 4-November 06 Member No.: 13 |
The problem with the mission objectives are their names. Change them from OBJ_1 to OBJ_EAST_1 and so on, depending on the side which you want to show them to...
As for those scripting commands, simply create a trigger for each player on the map which gets activated repeadetly (gets executed everytime the player respawns / mission starts) and type those commands on the OnActivation field. Remember to change the name 'player'/'this' on the commands to the actual unit name. You'll need to do that for every player in seperate triggers. |
|
|
Feb 3 2009, 17:21
Post
#9
|
|
Member Group: Members Posts: 161 Joined: 7-September 07 Member No.: 1,086 |
Thanks again for the help
a)The briefing regardless of what I do to it doesn't seem to want to work. I have gotten the scripts I am using to reinitialize after each spawn in thanks to your idea Now on to new stuff In this mission I have Weapon Caches which as stated in the snippet are the objectives of the Blufor. Currently they are considered destroyed when a Blufor Unit activates and occupies a 5x5 trigger for 1 minute surrounding the box. The Opfor Insurgents can also get better weapons (considering they are all riflemen to start), and they too have a 5x5 trigger that replenishes these caches on a 3 minute timer. The problem is that I want to make the weapon cache(s) spawn in somewhat random locations I know this can be accomplished via grouping the weapon cache object to different markers. Now the problem I face is how can I make the triggers that toggle the weapon cache's destruction/replenishment to follow the Weapon Cache object depending on where it randomly spawns [I figure if this isn't possible I can just add a script, but then I am not sure how to make scripts specific to side, as I would be adding both actions to the Weapons Cache thus making it possible for Opfor to destroy what they are meant to defend]. Also I have a marker for Opfor which is hidden just so they can know the location of their own Weapon Cache without Blufor having any knowledge of it, and I know you can make marker's follow/move to a certain location but the code seems to have abandoned me at the moment, I think its something like getpos or something?? Also, is it possible to display a variable to the players? I.E. everytime a Blufor spawns in I would like to be able to display how many reinforcements they have left. Thanks in advance This post has been edited by communistbastard: Feb 3 2009, 17:37 |
|
|
Lo-Fi Version | Time is now: 19th April 2024 - 08:22 |