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


Show Posts

* Messages | Topics | Attachments

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Messages - Binary101010

Pages: [1]
1
Yep, that was the problem! Removed the local from the lines defining the other peds and everything worked exactly as expected. I now have a fully working one-part mission. Now to expand it out into two or three parts. I'll definitely check back in if I need help. Thanks again!

2
DaBOSS54320, thank you for the very helpful notes. I will keep all of your advice in mind as I am working on the project.

I tried running the script with your modifications through the game. Unfortunately, I seem to be having a similar problem to before. The "congratulations" text is appearing on the screen immediately after starting the mission. I am also getting the standard yellow "You Passed" text for mission success immediately after that. So it would appear that the mission success trigger is working correctly, but the PedIsDead(Damon) trigger is firing off immediately at the beginning of the mission before I've had a chance to even lay a hand on him.

3
Looks like it stays on screen for somewhere between 3-4 seconds, disappears for 3 seconds, comes back for another 3-4 seconds, disappears for 3 seconds, and so on.

4
Well, the lack of the font info was definitely a problem. Can't believe I missed that as I got it right on the text at the beginning of the mission. And nobody else working on this project with me has even as much of a clue about LUA as I do (which isn't much).

However, it looks like there's a different problem now, as the "Congratulations" test is appearing immediately on the beginning of the mission. So I have to figure there's something about the PedIsDead trigger that's not working right. Any ideas?

5
Trying to put together some basic missions for a research study I'm helping with. The current intent is to simply spawn two peds, have one start attacking the other, and have the player intervene to protect the one being bullied. I'd also like a text message to come up when the bully is beaten up.

I've gotten everything working except that last part. When the player intervenes and beats up the bully... nothing happens. No text or anything. What am I missing?

Code: [Select]
ImportScript("\\Library\\LibTable.lua") -- imports the LibTable library
ImportScript("\\Library\\LibPed.lua") -- imports the LibPed library
local l_0_0 = false
 
MissionSetup = function() -- basic mission setup function which is used in almost all bully scripts
  local l_1_0 = 270 -- X coords
  local l_1_1 = -110 -- Y coords
  local l_1_2 = 6.4000000953674 -- Z coords
  local Algernon = Nil -- Initialize bullied char
  local Damon = Nil -- Initialize bully
 
  DisablePunishmentSystem(true) -- Necessary to keep the prefects from interfering
  PlayerSetHealth(200) -- gives the player 200 health
  AreaTransitionXYZ(0, l_1_0, l_1_1, l_1_2) -- Moves player to outside boys' dorm
  TextPrintString("Algernon is one of the geeks at school. He needs protection from Damon, the jock who has been bullying him.", 4, 1) -- Posts red text on screen
  Algernon = PedCreateXYZ(4,265,-110,6.4000000953674) -- Spawn bully target
  Damon = PedCreateXYZ(12,262,-110,6.4000000953674) -- Spawn bully
  PedRecruitAlly(Algernon,gplayer) -- Second character assigned to bodyguard first
  PedAttack(Damon, Algernon, 1) -- Bully attacks target
  PedShowHealthBar(Algernon, true, "N_Algernon", true) -- Display Algernon's health bar
end

MissionCleanup = function()
end -- end statement
 
 F_MissionCheck = function()
 if PedIsDead(Damon) then
  TextPrintString("Congratulations! Algernon is safe for now thanks to your intervention.") -- This is where I need help, this text never appears
  end
  end
 
main = function() -- Main mission function
  repeat
  F_MissionCheck()
  Wait(2000)
  until not Alive
  end

Pages: [1]