Login x
User Name:
Password:
Social Links Facebook Twitter YouTube Steam RSS News Feeds

Members Online

»
0 Active | 87 Guests
Online:

LATEST FORUM THREADS

»
CoD: Battle Royale
CoD+UO Map + Mod Releases
Damaged .pk3's
CoD Mapping
heli to attack ai
CoD4 SP Mapping

Forums

»

Welcome to the MODSonline.com forums. Looking for Frequently Asked Questions? Check out our FAQs section or search it out using the SEARCH link below. If you are new here, you may want to check out our rules and this great user's guide to the forums and the website.
For more mapping and modding information, see our Wiki: MODSonWiki.com

Jump To:
Forum: All Forums : Operation Flashpoint
Category: OFPDR Mission Editor
Operation Flashpoint: Dragon Rising mission editor.
Moderators: foyleman, Foxhound, Mystic, StrYdeR, batistablr, Welshy, DrBiggzz
Latest Posts
Subscribed Posts
Search
Restricted Access Topic is Locked subscribe
Author Topic: [Sample Script] Helicopter Re-enforcement
zeroy
General Member
Since: Nov 26, 2007
Posts: 1060
Last: Mar 12, 2014
[view latest posts]
Level 8
Category: OFPDR Mission Editor
Posted: Tuesday, Oct. 13, 2009 10:07 pm
I finally figured out how to get the Heli waypoint + dismount squad to work so i thought i'll share what i have :D

What this Sample do:

- Player spawns alone
- Heli + pilot + squad are spawn on Player entering Zone
- Heli take off and follows waypoint path
- Heli lands on last Waypoint
- Squad Disembark and are assign to follow player
- Heli leaves and dissapear on his last Waypoint

This might be useful if you have a mission where you want the player to start alone but be helped at some point during a mission.

DOWNLOAD SAMPLE HERE

The MAP setup

The script:

Code:

function onMissionStart()
OFP:displaySystemMessage("Walk forward to Spawn Heli and crew")
end

function onEnter_triggerzone(zoneName, UnitName) -- Trigger to spawn Heli + Pilot + Squad
OFP:activateEntitySet("Allies","ADDTOFRONT") -- Spawning the Entity containing Heli + Pilot + Squad
OFP:move("Echelon2","waypointp","ADDTOFRONT") -- Heli takes off and follow Waypoint Path
OFP:disableEvent("onEnter_triggerzone") -- Removing the Trigger Event
end

function onArriveAtWaypoint_vu25mh60s_waypointI18(entityName, waypointName)
OFP:land("vu25mh60s", "ADDTOFRONT") -- Heli Lands on arriving at last Waypoint
end

function onLand_vu25mh60s(HelicopterName) -- When Heli lands do this
OFP:displaySystemMessage("Heli has landed") -- For debug
OFP:addTimer("timer1", 10000) -- Starting a 10 seconds timer
OFP:detach("Echelon2", "iu33uspilot") -- detaching the Pilot from Squad Echelon
end

function onTimer_timer1(name) -- When timer ends do this
OFP:displaySystemMessage("Crew Disembark") -- For debug
OFP:dismountVehicle("Echelon2", "OVERRIDE") -- Squad Dismount the Heli
OFP:addTimer("timer2", 5000) -- Starting a 5 seconds timer
end

function onTimer_timer2(name)
OFP:displaySystemMessage("Pilot Leaves") -- For debug
OFP:move("iu33uspilot", "waypointI1p", "OVERRIDE") -- Pilot + heli now leave and follow Waypoint Path
OFP:detach("Echelon2", "iu08usrfl") -- Detach squad member from Echelon2
OFP:detach("Echelon2", "iu15uslmg") -- Detach squad member from Echelon2
OFP:detach("Echelon2", "iu19usat") -- Detach squad member from Echelon2
OFP:attach("Echelon", "iu08usrfl") -- Squad member now under your control :D
OFP:attach("Echelon", "iu15uslmg") -- Squad member now under your control :D
OFP:attach("Echelon", "iu19usat") -- Squad member now under your control :D
end

function onArriveAtWaypoint_vu25mh60s_waypointI2(entityName, waypointName) -- When Heli arrives here do this
OFP:despawnEntity("vu25mh60s") -- Remove Heli
OFP:despawnEntity("iu33uspilot") -- Remove Pilot
OFP:removeTimer("timer1") -- Removing timer 1
OFP:removeTimer("timer2") -- Removing timer 2
end


EDIT: new download, rev 1.1 : i fixed a problem where the player could not command the Squad.
Share |
Restricted Access Topic is Locked subscribe
MODSonline.com Forums : Operation Flashpoint : OFPDR Mission Editor

Latest Syndicated News

»
Codutility.com up and runn...
Nice, and there still using the logo and template for the screenshots, which...
Codutility.com up and runn...
dundy writes...Quote:Call of Duty modding and mapping is barly alive only a ...
Codutility.com up and runn...
Mystic writes...Quote:It seems to me the like the site is completely dead? ...
Codutility.com up and runn...
It seems to me the like the site is completely dead?

Partners & Friends

»