I have some questions to ask...
+2
TheGeneral
Morieza
6 posters
Operation Flashpoint Dragon Rising OFDR Forums :: OPERATION FLASHPOINT: DRAGON RISING :: OFDR EDITING :: EDITING Q+A
Page 3 of 3
Page 3 of 3 • 1, 2, 3
Re: I have some questions to ask...
I just wrote some functions, then suddenly I find you have done this long long time ago... I'm wondering which particle effect you used in SAM missle launcher model.
It seems that my friends have no interest in it, so I want to paste a gif picture here but I failed...
In any case, this stimulated me because I can write model as same as yours with a low quality.![Very Happy](https://2img.net/i/fa/i/smiles/icon_biggrin.png)
It seems that my friends have no interest in it, so I want to paste a gif picture here but I failed...
In any case, this stimulated me because I can write model as same as yours with a low quality.
![Very Happy](https://2img.net/i/fa/i/smiles/icon_biggrin.png)
runerback- Location : China
Points : 153
Reputation : 5
Join date : 2014-06-18
Re: I have some questions to ask...
I found the way to make soldiers jump in game.
blocker:
![I have some questions to ask... - Page 3 Aoe10](https://i.servimg.com/u/f39/18/91/66/34/aoe10.png)
- Code:
function onMissionStart()
if not hidden then
hidden=true
OFP:activateEntitySet("hid")
end
OFP:setInvulnerable("ip06plfldr",true)
end
function jump(jumper)
if isJumper(jumper) then
local x,y,z=OFP:getPosition(jumper)
EDX:serialTimer("startJump",500,OFP:spawnEntitySetAtLocation("blocker",x,y+0.65,z),jumper)
else
return
end
end
function startJump(id,jumper,timerID)
OFP:destroyEntitySet(id)
end
function isJumper(unitName)
if OFP:getBroadUnitCategory(unitName)=="BROAD_UNIT_SOLDIER" then
if OFP:getStance(unitName)=="EStanding" then
return true
else
return false
end
else
return false
end
end
function numpad0()
jump("ip06plfldr")
end
blocker:
![I have some questions to ask... - Page 3 Aoe10](https://i.servimg.com/u/f39/18/91/66/34/aoe10.png)
runerback- Location : China
Points : 153
Reputation : 5
Join date : 2014-06-18
Re: I have some questions to ask...
I have a problem in a dropping fire ball model.
![I have some questions to ask... - Page 3 0012](https://i.servimg.com/u/f39/18/91/66/34/0012.jpg)
When the fire get to ground, it should be an explosion there, but sometimes it doesn't work or exploded at wrong entity position.
I'll show my code for a solution.
There is a reconPoint in entity set "flare".
![I have some questions to ask... - Page 3 010](https://i.servimg.com/u/f39/18/91/66/34/010.jpg)
![I have some questions to ask... - Page 3 112](https://i.servimg.com/u/f39/18/91/66/34/112.jpg)
![I have some questions to ask... - Page 3 0012](https://i.servimg.com/u/f39/18/91/66/34/0012.jpg)
When the fire get to ground, it should be an explosion there, but sometimes it doesn't work or exploded at wrong entity position.
I'll show my code for a solution.
- Code:
function lineInit()
if not initline then
Line={}
OFP:addTimer("lineStart",1000)
initline=true
end
end
function newLine(x,y,z,h_dir,v_dir,speed)
if not initline then
lineInit()
end
local newLine={}
newLine.x=x
newLine.y=y+OFP:getTerrainHeight(x,z)
newLine.z=z
newLine.h_dir=h_dir
newLine.v_dir=v_dir
newLine.speed=speed
newLine.boom=false
newLine.state=true
table.insert(Line,newLine)
end
function lineStart()
OFP:setTimer("lineStart",100)
for line_k,line_v in pairs(Line) do
if line_v.state then
if math.mod(line_v.v_dir,90)==0 then
line_v.x=line_v.x
line_v.z=line_v.z
else
line_v.x=line_v.x+(line_v.speed*math.cos(math.rad(line_v.v_dir)))*math.sin(math.rad(line_v.h_dir))
line_v.z=line_v.z-(line_v.speed*math.cos(math.rad(line_v.v_dir)))*math.cos(math.rad(line_v.h_dir))
end
line_v.y=line_v.y+line_v.speed*math.sin(math.rad(line_v.v_dir))
OFP:destroyEntitySet(OFP:spawnEntitySetAtLocation("flare",line_v.x,line_v.y,line_v.z))
end
end
end
function onSpawnedReady( setName, setID, tableOfEntities, errorCode )
if setName=="flare" then
if setID then
for line_k,line_v in pairs(Line) do
if line_v.state then
if line_v.y<=OFP:getTerrainHeight(line_v.x,line_v.z)+1 then
if not line_v.boom then
line_v.boom=true
local dist=OFP:getDistance(tableOfEntities[1],EDX:getPrimaryPlayer())
if dist<=10 then
OFP:damage(EDX:getPrimaryPlayer(),bodyzone[math.random(1,#bodyzone)],5)
end
if dist > 1500 then
dist=1500
end
OFP:playOneShotSound("flashpoint2","exp","explosion",line_v.x,line_v.y,line_v.z,math.random(5,11),dist,0)
local posx,posy,posz=OFP:getPosition(tableOfEntities[1])
if posy<=OFP:getTerrainHeight(posx,posz)+10 then
OFP:doParticleEffect("X_EXPL_HMORT_Master1",tableOfEntities[1])
end
line_v.boom=false
table.remove(Line,line_k)
line_v.state=nil
end
end
end
end
OFP:doParticleEffect("X_IMPT_EXPL_Master1",tableOfEntities[1])
end
end
end
There is a reconPoint in entity set "flare".
- Code:
function onMissionStart()
OFP:addTimer("t0",6000)
end
function t0()
newLine(6000,100,-11610,90,-90,1)
newLine(6000,115,-11675,90,-50,1)
newLine(6000,135,-11625,90,-60,1)
newLine(6000,175,-11600,90,-70,1)
newLine(6000,200,-11635,90,-80,1)
end
![I have some questions to ask... - Page 3 010](https://i.servimg.com/u/f39/18/91/66/34/010.jpg)
![I have some questions to ask... - Page 3 112](https://i.servimg.com/u/f39/18/91/66/34/112.jpg)
runerback- Location : China
Points : 153
Reputation : 5
Join date : 2014-06-18
Re: I have some questions to ask...
I wish I had more time to look over your code and help you out. I'm back in school and just have too much on my plate right now. If I have a chance tomorrow I'll post the camera examples and try to analyze this a bit for you. Sorry.
Cheers![Very Happy](https://2img.net/i/fa/i/smiles/icon_biggrin.png)
Cheers
![Very Happy](https://2img.net/i/fa/i/smiles/icon_biggrin.png)
Re: I have some questions to ask...
Never mind. I'm not hurry.
I just uploaded a vedio.
Stole from you.....
Another SAM
I just uploaded a vedio.
![Cool](https://2img.net/i/fa/i/smiles/icon_cool.gif)
Another SAM
runerback- Location : China
Points : 153
Reputation : 5
Join date : 2014-06-18
Re: I have some questions to ask...
I see the jump thing being interesting but you haven't really described what the motivation or how you can do this from a non coders point of view.
Does the user have to press a key or something to fucntion this??? There is already a function in game as everyone knows to climb over stuff.
Does the user have to press a key or something to fucntion this??? There is already a function in game as everyone knows to climb over stuff.
Re: I have some questions to ask...
I'm using EDX and hotkey. So when press numpad0 the soldier will jump.
When spawned some objects at soldier's head position, this character will bend his legs, then destroy entity set which spawned before, this soldier will jump. In my code soldier will jump to ten meters tall air...
When spawned some objects at soldier's head position, this character will bend his legs, then destroy entity set which spawned before, this soldier will jump. In my code soldier will jump to ten meters tall air...
runerback- Location : China
Points : 153
Reputation : 5
Join date : 2014-06-18
Re: I have some questions to ask...
I uploaded a vedio about "jump" yesterday. Another is uploading.
Watch here
Be advised, poor quality...
Watch here
Be advised, poor quality...
runerback- Location : China
Points : 153
Reputation : 5
Join date : 2014-06-18
Re: I have some questions to ask...
if spawning an object under a soldiers feet "bumped them up" a bit - I can see how that would feel a lot like a jump to the player
John J. Stevens- Admin
- Location : WV/PA
Points : 285
Reputation : 22
Join date : 2012-12-19
Re: I have some questions to ask...
I want to use 'OFP:registerOnReconFunction()' for a sniper map, but it dosen't work until I put this function into Level.lua. How to use it in secondary scripts?
runerback- Location : China
Points : 153
Reputation : 5
Join date : 2014-06-18
Re: I have some questions to ask...
This is one of the rare instances when you will need to use Level.lua to script. The reason for this is that the game is coded to make these native calls to the level script. In most cases for the EDX they are also made on the waypoints script or I have created pointers to fire the native functions on the waypoints script. In the case of recon points, the function is specified by the user and therefore must be created on the level script since there is no mechanism built into the EDX to intercept the function call and redirect it to the other secondary scripts. One way to do this on your own is to create your function on the level script and inside of it use EDX:distributeFunction("yourFunctionName", "yourVars"...); This will fire a function on all scripts where the function exists by the name specified in the call. You can pass the variables straight from the function into distributeFunction call. Hope this helps ![Smile](https://2img.net/i/fa/i/smiles/icon_smile.gif)
Cheers![Very Happy](https://2img.net/i/fa/i/smiles/icon_biggrin.png)
![Smile](https://2img.net/i/fa/i/smiles/icon_smile.gif)
Cheers
![Very Happy](https://2img.net/i/fa/i/smiles/icon_biggrin.png)
Re: I have some questions to ask...
Thanks! I figured it out.
I have another question about 'OFP:registerOnReconFunction()'. This function only return unitName which triggered reconFunction, but I want to know which target the player is aiming at in game. I regist reconFunction then insert the reconPointName to a table, so when the trigger function is called I will know which reconPoint is triggered. In this way I can only regist one reconFunction at the same time. Is there a better way?
![Smile](https://2img.net/i/fa/i/smiles/icon_smile.gif)
I have another question about 'OFP:registerOnReconFunction()'. This function only return unitName which triggered reconFunction, but I want to know which target the player is aiming at in game. I regist reconFunction then insert the reconPointName to a table, so when the trigger function is called I will know which reconPoint is triggered. In this way I can only regist one reconFunction at the same time. Is there a better way?
runerback- Location : China
Points : 153
Reputation : 5
Join date : 2014-06-18
Re: I have some questions to ask...
When helicopters are hit, why 'onHit' event will be triggered twice?
runerback- Location : China
Points : 153
Reputation : 5
Join date : 2014-06-18
Re: I have some questions to ask...
I made a telepot system in game, maybe it's boring...
Download
Download
runerback- Location : China
Points : 153
Reputation : 5
Join date : 2014-06-18
Re: I have some questions to ask...
One question about EDX:
I want to damage the unit who entered fire zone, and stop damaging when leave.
But there is a wrong message...
I want to damage the unit who entered fire zone, and stop damaging when leave.
- Code:
function onEnter(zoneName, unitName)
if string.sub(zoneName,1,3)=='fir' then
EDX:serialTimer('firedamage',100,zoneName, unitName)
end
end
function firedamage(zone,victim,timerID)
EDX:setTimer(timerID,160,victim)
if OFP:isInTrigger(victim,zone) then
OFP:damage(victim,gamedata.bodyzone[math.random(1,#gamedata.bodyzone)],1)
else
EDX:deleteTimerVar(timerID,zone,victim)
end
end
But there is a wrong message...
runerback- Location : China
Points : 153
Reputation : 5
Join date : 2014-06-18
Re: I have some questions to ask...
I'm not using EDX, but with my limited scripting knowledge i have created this alternative
Assumes team1 as the Echelon name, with units us1 and us2 as players, and a triggerzone called firezone
Assumes team1 as the Echelon name, with units us1 and us2 as players, and a triggerzone called firezone
- Code:
function onEnter_firezone(zoneName, unitName)
if OFP:isEchelon("team1") then
OFP:displaySystemMessage("RADIATION...GET OUT OF HERE NOW...!!")
OFP:addTimer("firezone",100)
--repeating trigger, no OFP:disableEvent
end
end
function onTimer_firezone()
OFP:removeTimer("firezone"); -- not sure if this line is needed
if OFP:isInTrigger("team1","firezone") then
if OFP:isUnit("us1") then OFP:damage("us1","chestzone",5) end
if OFP:isUnit("us2") then OFP:damage("us2","chestzone",5) end
if OFP:isUnit("us3") then OFP:damage("us3","chestzone",5) end
if OFP:isUnit("us4") then OFP:damage("us4","chestzone",5) end
-- Repeat process
OFP:displaySystemMessage("...WARNING...WARNING !!")
OFP:addTimer("firezone",10000)
-------------------------------------------------------
-- zonetiming = OFP:getTimer ("firezone")
-- zonetiming = zonetiming/1000;
-- OFP:displaySystemMessage("Next Lethal Dose In "..zonetiming.."seconds")
----------------------------------------------------------------------
else
--end process
OFP:removeTimer("firezone");
-- OFP:displaySystemMessage("..YOU ARE CLEAR OF THE ZONE...!!")
end
end
function onLeave_firezone(zoneName, unitName)
if not OFP:isInTrigger("team1","firezone") then
OFP:displaySystemMessage("..YOU ARE CLEAR OF THE ZONE...!!")
end
end
Re: I have some questions to ask...
The error is in the EDX:setTimer function, you only reloaded one of the parameters. With the EDX you don't need to reload the parameters, but if you do you have to reload all of them. You also only need to pass the timerID in the delete timer function. Hope this helps.runerback wrote:One question about EDX:
I want to damage the unit who entered fire zone, and stop damaging when leave.
- Code:
function onEnter(zoneName, unitName)
if string.sub(zoneName,1,3)=='fir' then
EDX:serialTimer('firedamage',100,zoneName, unitName)
end
end
function firedamage(zone,victim,timerID)
EDX:setTimer(timerID,160,victim)
if OFP:isInTrigger(victim,zone) then
OFP:damage(victim,gamedata.bodyzone[math.random(1,#gamedata.bodyzone)],1)
else
EDX:deleteTimerVar(timerID,zone,victim)
end
end
But there is a wrong message...
Cheers
![Very Happy](https://2img.net/i/fa/i/smiles/icon_biggrin.png)
Re: I have some questions to ask...
Ah, I need a document about EDX, I think...
Below is the code, and EDX really make things simple.
Below is the code, and EDX really make things simple.
![Smile](https://2img.net/i/fa/i/smiles/icon_smile.gif)
- Code:
--[[
firedamagezone={
'headzone',
'chestzone',
'abdomenzone',
'larmzone',
'rarmzone',
'llegzone',
'rlegzone',
'llegzone',
'rlegzone'
}
--]]
function onEnter(zoneName, unitName)
if string.sub(zoneName,1,3)=='fir' then
EDX:serialTimer('firedamage',100,zoneName,unitName)
end
end
function firedamage(zone,unit,timerID)
EDX:setTimer(timerID,160)
if OFP:isAlive(unit) and OFP:isInTrigger(unit,zone) then
if OFP:isPlayer(unit) or OFP:isSecondaryPlayer(unit) then
OFP:damage(unit,firedamagezone[math.random(1,#firedamagezone)],1)
else
OFP:damage(unit,firedamagezone[math.random(1,#firedamagezone)],3)
end
else
EDX:deleteTimer(timerID)
end
end
runerback- Location : China
Points : 153
Reputation : 5
Join date : 2014-06-18
Re: I have some questions to ask...
How to set timer with 10 ms? updateFrame is slow...
runerback- Location : China
Points : 153
Reputation : 5
Join date : 2014-06-18
Re: I have some questions to ask...
LOL... the game only processes at the speed of the frames. You're asking the engine to do something that it won't do. Why do you need a timer firing at 10ms?? That kind of speed would probably bring this game engine to it's knees, even if you could set a time that low. The smallest time you can get in this game is 100ms, no exceptions. Using update frame will get you a slight advantage over that, but you're putting a big load on the cpu when you use it, so I would suggest keeping that set aside for very special circumstances.
Re: I have some questions to ask...
I want to let cameras follow a vehicle so I can record video in different perspective, but the vehicle will "shake" all the time, even if in updataFrame function... Maybe in a 10ms timer the camera will be smooth, I guess... ![Neutral](https://2img.net/i/fa/i/smiles/icon_neutral.gif)
![Neutral](https://2img.net/i/fa/i/smiles/icon_neutral.gif)
runerback- Location : China
Points : 153
Reputation : 5
Join date : 2014-06-18
Re: I have some questions to ask...
How to create cameras controlled by numpad?
These code is not right and nothing happened in game but id with value '1'... And I find there is no codes to controll cameras move such as move forware, left, right, back with numpad. In a word, I need some description about this model, really...
- Code:
EDX:initCams()
local id=EDX:createCamera()
EDX:setCamera(id,'player',1,0,180,false)
EDX:setCameraMotion(id,1,1,1,1)
EDX:activateControlledCamera(id)
--EDX:activateCamera(id)
These code is not right and nothing happened in game but id with value '1'... And I find there is no codes to controll cameras move such as move forware, left, right, back with numpad. In a word, I need some description about this model, really...
- Code:
--[[
EDX:initCams()
EDX:disableCams()
EDX:createCamera()
EDX:setCamera()
EDX:setCameraMotion()
EDX:setCameraTarget()
EDX:setCameraFollowTarget()
EDX:activateCamera()
EDX:deactivateCamera()
EDX:deleteCamera()
EDX:camSnapShot()
EDX:activateControlledCamera()
EDX:displayCameraInfo()
EDX:getCameraPosition()
EDX:camMoveToTarget()
EDX:camTargetEntity()
--]]
runerback- Location : China
Points : 153
Reputation : 5
Join date : 2014-06-18
Re: I have some questions to ask...
Camera control requires the use of AUTOHOTKEY to pass the keyboard controls to your script - the editor does not have any native key capture events. There is a default .AHK script provided in TVIGs EDx files and missions.
If you start looking into the well documented language of AUTOHOTKEY, you will also notice a number of other functions available that OFDR could never master like popup graphics or even custom menu systems.
If you start looking into the well documented language of AUTOHOTKEY, you will also notice a number of other functions available that OFDR could never master like popup graphics or even custom menu systems.
John J. Stevens- Admin
- Location : WV/PA
Points : 285
Reputation : 22
Join date : 2012-12-19
Page 3 of 3 • 1, 2, 3
Operation Flashpoint Dragon Rising OFDR Forums :: OPERATION FLASHPOINT: DRAGON RISING :: OFDR EDITING :: EDITING Q+A
Page 3 of 3
Permissions in this forum:
You cannot reply to topics in this forum
|
|