News: Welcome back to Bullworth! If you haven't already, you will need to reset your password..


Author Topic: Darby Ped Evades?  (Read 4657 times)

0 Members and 1 Guest are viewing this topic.

Offline barca769

  • Jr. Member
  • **
  • Posts: 25
  • Gender: Male
  • Never Ending
    • View Profile
Darby Ped Evades?
« on: March 19, 2016, 05:33:01 AM »
after a long time I saw Darby to fight someone . I feel something is missing , Darby did not use "Evades"
I put the code from Darby (ide.img)
Code: [Select]
PRlead_Darby....PRlead_Darby_W......Large...PREPPY.STAT_P_BOXING...F_DARBY.Evade_Duck..Boxing..P_Grappler....../Global/BOSS_Darby......Act/Anim/BOSS_Darby.act./Global/AI..Act/AI/AI.act...N_Darby
and Change "Striker" to "Generic" in pedstats. can anyone can help me to use darby evades?

Sorry for my bad english :neen:

Offline AlphaTech

  • LostInSpace
  • Sr. Member
  • ***
  • Posts: 758
  • Gender: Male
  • The name's AlphaTECH, whatca need help with?! :)
    • View Profile
Re: Darby Ped Evades?
« Reply #1 on: March 19, 2016, 02:04:08 PM »
With Darby's evades you must script his AI.

Code: [Select]
function main()
Darby = PedCreateXYZ(37,  -733.0169067, 387.4291382, 298.0368652)
PedSetAITree(Darby, "/Global/DarbyAI", "Act/AI/AI_DARBY_2_B.act")
  repeat
Respawn_Darby()
    Wait(0)
  until not Alive
end

function Respawn_Darby()
if PedIsDead(Darby) then
Darby = PedCreateXYZ(37,  -733.0169067, 387.4291382, 298.0368652)
 
PedSetAITree(Darby, "/Global/DarbyAI", "Act/AI/AI_DARBY_2_B.act")
end

F_AttendedClass = function()
  if IsMissionCompleated("3_08") and not IsMissionCompleated("3_08_PostDummy") then
    return
  end
  SetSkippedClass(false)
  PlayerSetPunishmentPoints(0)
end
 
F_MissedClass = function()
  if IsMissionCompleated("3_08") and not IsMissionCompleated("3_08_PostDummy") then
    return
  end
  SetSkippedClass(true)
  StatAddToInt(166)
end
 
F_AttendedCurfew = function()
  if not PedInConversation(gPlayer) and not MissionActive() then
    TextPrintString("You got home in time for curfew", 4)
  end
end
 
F_MissedCurfew = function()
  if not PedInConversation(gPlayer) and not MissionActive() then
    TextPrint("TM_TIRED5", 4, 2)
  end
end
 
F_StartClass = function()
  if IsMissionCompleated("3_08") and not IsMissionCompleated("3_08_PostDummy") then
    return
  end
  F_RingSchoolBell()
  local l_6_0 = PlayerGetPunishmentPoints() + GetSkippingPunishment()
end
 
F_EndClass = function()
  if IsMissionCompleated("3_08") and not IsMissionCompleated("3_08_PostDummy") then
    return
  end
  F_RingSchoolBell()
end
 
F_StartMorning = function()
  F_UpdateTimeCycle()
end
 
F_EndMorning = function()
  F_UpdateTimeCycle()
end
 
F_StartLunch = function()
  if IsMissionCompleated("3_08") and not IsMissionCompleated("3_08_PostDummy") then
    F_UpdateTimeCycle()
    return
  end
  F_UpdateTimeCycle()
end
 
F_EndLunch = function()
  F_UpdateTimeCycle()
end
 
F_StartAfternoon = function()
  F_UpdateTimeCycle()
end
 
F_EndAfternoon = function()
  F_UpdateTimeCycle()
end
 
F_StartEvening = function()
  F_UpdateTimeCycle()
end
 
F_EndEvening = function()
  F_UpdateTimeCycle()
end
 
F_StartCurfew_SlightlyTired = function()
  F_UpdateTimeCycle()
end
 
F_StartCurfew_Tired = function()
  F_UpdateTimeCycle()
end
 
F_StartCurfew_MoreTired = function()
  F_UpdateTimeCycle()
end
 
F_StartCurfew_TooTired = function()
  F_UpdateTimeCycle()
end
 
F_EndCurfew_TooTired = function()
  F_UpdateTimeCycle()
end
 
F_EndTired = function()
  F_UpdateTimeCycle()
end

F_Nothing = function()
end
 
F_ClassWarning = function()
  if IsMissionCompleated("3_08") and not IsMissionCompleated("3_08_PostDummy") then
    return
  end
  local l_23_0 = math.random(1, 2)
end
 
F_UpdateTimeCycle = function()
  if not IsMissionCompleated("1_B") then
    local l_24_0 = GetCurrentDay(false)
    if l_24_0 < 0 or l_24_0 > 2 then
      SetCurrentDay(0)
    end
  end
  F_UpdateCurfew()
end
 
F_UpdateCurfew = function()
  local l_25_0 = shared.gCurfewRules
  if not l_25_0 then
    l_25_0 = F_CurfewDefaultRules
  end
  l_25_0()
end
 
F_CurfewDefaultRules = function()
  local l_26_0 = ClockGet()
  if l_26_0 >= 23 or l_26_0 < 7 then
    shared.gCurfew = true
  else
    shared.gCurfew = false
  end
end
« Last Edit: March 19, 2016, 02:33:36 PM by AlphaTech »

Offline barca769

  • Jr. Member
  • **
  • Posts: 25
  • Gender: Male
  • Never Ending
    • View Profile
Re: Darby Ped Evades?
« Reply #2 on: March 20, 2016, 11:58:37 AM »
With Darby's evades you must script his AI.

Code: [Select]
function main()
Darby = PedCreateXYZ(37,  -733.0169067, 387.4291382, 298.0368652)
PedSetAITree(Darby, "/Global/DarbyAI", "Act/AI/AI_DARBY_2_B.act")
  repeat
Respawn_Darby()
    Wait(0)
  until not Alive
end

function Respawn_Darby()
if PedIsDead(Darby) then
Darby = PedCreateXYZ(37,  -733.0169067, 387.4291382, 298.0368652)
 
PedSetAITree(Darby, "/Global/DarbyAI", "Act/AI/AI_DARBY_2_B.act")
end

F_AttendedClass = function()
  if IsMissionCompleated("3_08") and not IsMissionCompleated("3_08_PostDummy") then
    return
  end
  SetSkippedClass(false)
  PlayerSetPunishmentPoints(0)
end
 
F_MissedClass = function()
  if IsMissionCompleated("3_08") and not IsMissionCompleated("3_08_PostDummy") then
    return
  end
  SetSkippedClass(true)
  StatAddToInt(166)
end
 
F_AttendedCurfew = function()
  if not PedInConversation(gPlayer) and not MissionActive() then
    TextPrintString("You got home in time for curfew", 4)
  end
end
 
F_MissedCurfew = function()
  if not PedInConversation(gPlayer) and not MissionActive() then
    TextPrint("TM_TIRED5", 4, 2)
  end
end
 
F_StartClass = function()
  if IsMissionCompleated("3_08") and not IsMissionCompleated("3_08_PostDummy") then
    return
  end
  F_RingSchoolBell()
  local l_6_0 = PlayerGetPunishmentPoints() + GetSkippingPunishment()
end
 
F_EndClass = function()
  if IsMissionCompleated("3_08") and not IsMissionCompleated("3_08_PostDummy") then
    return
  end
  F_RingSchoolBell()
end
 
F_StartMorning = function()
  F_UpdateTimeCycle()
end
 
F_EndMorning = function()
  F_UpdateTimeCycle()
end
 
F_StartLunch = function()
  if IsMissionCompleated("3_08") and not IsMissionCompleated("3_08_PostDummy") then
    F_UpdateTimeCycle()
    return
  end
  F_UpdateTimeCycle()
end
 
F_EndLunch = function()
  F_UpdateTimeCycle()
end
 
F_StartAfternoon = function()
  F_UpdateTimeCycle()
end
 
F_EndAfternoon = function()
  F_UpdateTimeCycle()
end
 
F_StartEvening = function()
  F_UpdateTimeCycle()
end
 
F_EndEvening = function()
  F_UpdateTimeCycle()
end
 
F_StartCurfew_SlightlyTired = function()
  F_UpdateTimeCycle()
end
 
F_StartCurfew_Tired = function()
  F_UpdateTimeCycle()
end
 
F_StartCurfew_MoreTired = function()
  F_UpdateTimeCycle()
end
 
F_StartCurfew_TooTired = function()
  F_UpdateTimeCycle()
end
 
F_EndCurfew_TooTired = function()
  F_UpdateTimeCycle()
end
 
F_EndTired = function()
  F_UpdateTimeCycle()
end

F_Nothing = function()
end
 
F_ClassWarning = function()
  if IsMissionCompleated("3_08") and not IsMissionCompleated("3_08_PostDummy") then
    return
  end
  local l_23_0 = math.random(1, 2)
end
 
F_UpdateTimeCycle = function()
  if not IsMissionCompleated("1_B") then
    local l_24_0 = GetCurrentDay(false)
    if l_24_0 < 0 or l_24_0 > 2 then
      SetCurrentDay(0)
    end
  end
  F_UpdateCurfew()
end
 
F_UpdateCurfew = function()
  local l_25_0 = shared.gCurfewRules
  if not l_25_0 then
    l_25_0 = F_CurfewDefaultRules
  end
  l_25_0()
end
 
F_CurfewDefaultRules = function()
  local l_26_0 = ClockGet()
  if l_26_0 >= 23 or l_26_0 < 7 then
    shared.gCurfew = true
  else
    shared.gCurfew = false
  end
end
after using this code . I do not see Darby in a dorm or in a fist club

Offline Toni C.

  • Jr. Member
  • **
  • Posts: 19
    • View Profile
Re: Darby Ped Evades?
« Reply #3 on: March 22, 2016, 12:40:40 PM »
Edit ide to 02 00 00.I think theres a code to make it in lua.

Offline DaBOSS54320

  • Hero Member
  • ****
  • Posts: 3,398
  • Gender: Female
    • View Profile
Re: Darby Ped Evades?
« Reply #4 on: March 22, 2016, 01:30:03 PM »
Code: [Select]
PRlead_Darby....PRlead_Darby_W......Large...PREPPY.STAT_P_BOXING...F_DARBY.Evade_Duck..Boxing..P_Grappler....../Global/BOSS_Darby......Act/Anim/BOSS_Darby.act./Global/AI..Act/AI/AI.act...N_Darby
What you did here with Evade_Duck is make the game try to load an animation group called Evade_Duck, when there is no such thing. I'm not absolutely sure on this but this may make it so Darby fails to spawn when the game tries to spawn him.

Those 4 things before the style tree are and after the stat are calling animation groups, and they get loaded when the ped is spawned.

If you want him to spawn in free-roam as an ambient ped, you'll need to change his unique model status as Toni C. started to say.



There is a stat for how frequently a ped evades attacks, and you can use the GameSetPedStat function to make it work.

GameSetPedStat(ped,13,100) -- makes ped have a 100% chance of evading incoming attacks.

Offline barca769

  • Jr. Member
  • **
  • Posts: 25
  • Gender: Male
  • Never Ending
    • View Profile
Re: Darby Ped Evades?
« Reply #5 on: March 23, 2016, 11:12:12 AM »
Code: [Select]
PRlead_Darby....PRlead_Darby_W......Large...PREPPY.STAT_P_BOXING...F_DARBY.Evade_Duck..Boxing..P_Grappler....../Global/BOSS_Darby......Act/Anim/BOSS_Darby.act./Global/AI..Act/AI/AI.act...N_Darby
What you did here with Evade_Duck is make the game try to load an animation group called Evade_Duck, when there is no such thing. I'm not absolutely sure on this but this may make it so Darby fails to spawn when the game tries to spawn him.

Those 4 things before the style tree are and after the stat are calling animation groups, and they get loaded when the ped is spawned.

If you want him to spawn in free-roam as an ambient ped, you'll need to change his unique model status as Toni C. started to say.



There is a stat for how frequently a ped evades attacks, and you can use the GameSetPedStat function to make it work.

GameSetPedStat(ped,13,100) -- makes ped have a 100% chance of evading incoming attacks.
Sorry. but can you give a little step from Darby evades?, because I do not really understand how to make it work :neen: :neen:

Offline GaryHarrington

  • A Guy Who Likes Open World and FPS Games
  • Sr. Member
  • ***
  • Posts: 515
  • Gender: Male
  • Just Love Bully and GTA ...Nothing Interested
    • View Profile
Re: Darby Ped Evades?
« Reply #6 on: April 25, 2016, 06:49:13 AM »
after a long time I saw Darby to fight someone . I feel something is missing , Darby did not use "Evades"
I put the code from Darby (ide.img)
Code: [Select]
PRlead_Darby....PRlead_Darby_W......Large...PREPPY.STAT_P_BOXING...F_DARBY.Evade_Duck..Boxing..P_Grappler....../Global/BOSS_Darby......Act/Anim/BOSS_Darby.act./Global/AI..Act/AI/AI.act...N_Darby
and Change "Striker" to "Generic" in pedstats. can anyone can help me to use darby evades?

Sorry for my bad english :neen:

If you just change the ped class, then darby will fully just block instead of evades like on his boss mission

Offline GaryHarrington

  • A Guy Who Likes Open World and FPS Games
  • Sr. Member
  • ***
  • Posts: 515
  • Gender: Male
  • Just Love Bully and GTA ...Nothing Interested
    • View Profile
Re: Darby Ped Evades?
« Reply #7 on: April 25, 2016, 06:50:21 AM »
Edit ide to 02 00 00.I think theres a code to make it in lua.

Didn't 01 00 00 enough?