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


Author Topic: Unlocking Doors [LUA]  (Read 10369 times)

0 Members and 1 Guest are viewing this topic.

Offline Unknownsoldier

  • Hero Member
  • ****
  • Posts: 2,773
    • View Profile
Unlocking Doors [LUA]
« on: July 10, 2015, 11:29:08 PM »
I know this has been done many times via Trigger. But I discovered a long time ago that it's also possible in Lua, and decided to share it because it was part of an old mod of mine which I never really told people about(just a small mod for fun).

So open Trigger.img which is in the DAT folder, all in the Bully folder. Open it in Notepad++ which can be downloaded here: https://notepad-plus-plus.org/download/v6.7.9.2.html

now that you have it open, press CTRL + F, and search either islocked true or "dt_.
either one works, but I use "dt_ more.

then should be some more information, then you should see the triggername strings (eg. TRIGGERNAME "DT_tschool_RoofDoor").

In your LUA script, somewhere that will only run once, such as MissionSetup, Main etc. put AreaSetDoorLocked(triggerName, false)

replace triggerName with the triggername you chose from Trigger.img.

For example. if I wanted to use this one:
Code: [Select]
TRIGGERNAME "DT_ischool_Art"
AREACODE 2
POSITION -671.481995, -291.666992, 5.480890
YAWPITCHROLL 0.000000, 0.000000, 0.000000
YAW 0.000037
ZHEIGHT 1.000000
ISMISSIONSPECIFIC FALSE
ISLOCKED TRUE
AMBIENT 255, 255, 255
USETIMECYCLE FALSE
HASPOPULATIONDATA 0
FORCEPOPREAD FALSE
HASAMBIENTVEHICLEDATA 0
FORCEVEHREAD FALSE

 i would do: AreaSetDoorLocked("DT_ischool_Art", false)

to lock them up again, change the false to true.

interior names(From Rambo7):
AreaSetDoorLocked("DT_tschool_AutoShopL", false) --Autoshop
AreaSetDoorLocked("DT_ischool_Door01", false) --Chemistry Class
AreaSetDoorLocked("DT_ischool_Classroom", false) --English/Maths/Geology Class
AreaSetDoorLocked("DT_ischool_Art", false) --Art Class
AreaSetDoorLocked("DT_ISCHOOL_BIO", false) --Biology Class
AreaSetDoorLocked("DT_ischool_Staff", false) --Staff Room
AreaSetDoorLocked("DT_ischool_AuditorBalc", false) -- Auditorium Balcony 2nd floor
AreaSetDoorLocked("DT_ischool_AuditorDoorL", false) -- Auditorium 1st floor
« Last Edit: July 11, 2015, 03:46:19 PM by Unknownsoldier »

Offline AlphaTech

  • LostInSpace
  • Sr. Member
  • ***
  • Posts: 758
  • Gender: Male
  • The name's AlphaTECH, whatca need help with?! :)
    • View Profile
Re: Unlocking Doors [LUA]
« Reply #1 on: July 11, 2015, 12:15:51 AM »
Goob job m8 I will get to making my mod where I unlock and make all spawn coords for the right doors and their interiors. I just set the spawn points for the interios but never unlocked the specific doors. I also got the gates for the autoshop, the doors in the hole,the doors in the chemplant plus the elevator and some of the other interiors. I haven't been modding lately but will get back to it soon.

deadpoolXYZ

  • Guest
Re: Unlocking Doors [LUA]
« Reply #2 on: July 11, 2015, 12:28:28 AM »
An easier way I personally use is to extract the specific .dat file for the interior I want and then use the search option. You can also check the areacode of the door to make sure that you are picking the right one.

Goob job m8 I will get to making my mod where I unlock and make all spawn coords for the right doors and their interiors. I just set the spawn points for the interios but never unlocked the specific doors. I also got the gates for the autoshop, the doors in the hole,the doors in the chemplant plus the elevator and some of the other interiors. I haven't been modding lately but will get back to it soon.

You are confusing the teleporting doors with the props/special entites like doors.
« Last Edit: July 11, 2015, 12:31:41 AM by The Dream Is Dead »

Offline gamerzod

  • Jr. Member
  • **
  • Posts: 17
    • View Profile
Re: Unlocking Doors [LUA]
« Reply #3 on: July 11, 2015, 03:06:14 AM »
so can this be used to open door for like the art class, biology class, auditorium, autoshop classs and other?

Offline Rambo7

  • "Awesomely Kick-Ass Troll"
  • Full Member
  • ***
  • Posts: 404
  • Gender: Male
  • #ZAMBess
    • View Profile
    • My ModDB Page
Re: Unlocking Doors [LUA]
« Reply #4 on: July 11, 2015, 03:53:34 AM »
^ Yes, it can

AreaSetDoorLocked("DT_tschool_AutoShopL", false) --Autoshop
AreaSetDoorLocked("DT_ischool_Door01", false) --Chemistry Class
AreaSetDoorLocked("DT_ischool_Classroom", false) --English/Maths/Geology Class
AreaSetDoorLocked("DT_ischool_Art", false) --Art Class
AreaSetDoorLocked("DT_ISCHOOL_BIO", false) --Biology Class
AreaSetDoorLocked("DT_ischool_Staff", false) --Staff Room
AreaSetDoorLocked("DT_ischool_AuditorBalc", false) -- Auditorium Balcony 2nd floor
AreaSetDoorLocked("DT_ischool_AuditorDoorL", false) -- Auditorium 1st floor

and btw I haven't found the door for the music classroom yet

For the principal room and the roofdoor, it just didn't work well, u must need to use the warp method, "AreaTransitionXYZ(areacode, x, y, z)"
AreaSetDoorLocked("DT_ischool_RoofDoor", false)
AreaSetDoorLocked("DT_ischool_PrincipalDoorL", false

ps. @soldier, if you want, you can quote my post here and put it in your first post, since I believe this could help people out

and I am still searching for the funhouse door, but somewhat I believe the funhouse must use the warp method too and it just won't work with the AreaSetDoorLocked code

Update: I already tried it, for the funhouse, and I failed
It has lots of animation to open a door from one place to another place, and I have totally no idea how to make it work
« Last Edit: July 11, 2015, 08:48:12 AM by Rambo7 »

deadpoolXYZ

  • Guest
Re: Unlocking Doors [LUA]
« Reply #5 on: July 11, 2015, 12:15:41 PM »
^ Yes, it can

AreaSetDoorLocked("DT_tschool_AutoShopL", false) --Autoshop
AreaSetDoorLocked("DT_ischool_Door01", false) --Chemistry Class
AreaSetDoorLocked("DT_ischool_Classroom", false) --English/Maths/Geology Class
AreaSetDoorLocked("DT_ischool_Art", false) --Art Class
AreaSetDoorLocked("DT_ISCHOOL_BIO", false) --Biology Class
AreaSetDoorLocked("DT_ischool_Staff", false) --Staff Room
AreaSetDoorLocked("DT_ischool_AuditorBalc", false) -- Auditorium Balcony 2nd floor
AreaSetDoorLocked("DT_ischool_AuditorDoorL", false) -- Auditorium 1st floor

and btw I haven't found the door for the music classroom yet

For the principal room and the roofdoor, it just didn't work well, u must need to use the warp method, "AreaTransitionXYZ(areacode, x, y, z)"
AreaSetDoorLocked("DT_ischool_RoofDoor", false)
AreaSetDoorLocked("DT_ischool_PrincipalDoorL", false

ps. @soldier, if you want, you can quote my post here and put it in your first post, since I believe this could help people out

and I am still searching for the funhouse door, but somewhat I believe the funhouse must use the warp method too and it just won't work with the AreaSetDoorLocked code

Update: I already tried it, for the funhouse, and I failed
It has lots of animation to open a door from one place to another place, and I have totally no idea how to make it work

Check my bullies mission I created a table with the coordinates of all the school interior doors. Compare the coords of the music room door with the one in trigger.img.

About the doors... I think you are confusing the normal doors (the ones that can be locked, for example the boys dorm door) with "props" or "entities" doors, the ones that are mostly mission specific and don't have a blip on it.
Some prop doors can be opened and closed with action nodes while others can only be opened setting them to follow a path and the speed.

Offline Unknownsoldier

  • Hero Member
  • ****
  • Posts: 2,773
    • View Profile
Re: Unlocking Doors [LUA]
« Reply #6 on: July 11, 2015, 05:39:25 PM »
The music door in game is the Home Economics room.

I only found this that could possibly be the door:

      POINTNAME "CLASS_MUSIC"
      AREACODE 2
      NPOINTPOINTS 1
      POINTPOINT -665.544006, -300.941010, 5.555000
[/i]



EDIT: the trigger posted above IS infact the door:
« Last Edit: July 11, 2015, 05:44:37 PM by Unknownsoldier »

Offline DaBOSS54320

  • Hero Member
  • ****
  • Posts: 3,398
  • Gender: Female
    • View Profile
Re: Unlocking Doors [LUA]
« Reply #7 on: July 11, 2015, 06:51:51 PM »
Music class and english class are in the same area.

Offline AlphaTech

  • LostInSpace
  • Sr. Member
  • ***
  • Posts: 758
  • Gender: Male
  • The name's AlphaTECH, whatca need help with?! :)
    • View Profile
Re: Unlocking Doors [LUA]
« Reply #8 on: July 11, 2015, 09:29:53 PM »
An easier way I personally use is to extract the specific .dat file for the interior I want and then use the search option. You can also check the areacode of the door to make sure that you are picking the right one.

Goob job m8 I will get to making my mod where I unlock and make all spawn coords for the right doors and their interiors. I just set the spawn points for the interios but never unlocked the specific doors. I also got the gates for the autoshop, the doors in the hole,the doors in the chemplant plus the elevator and some of the other interiors. I haven't been modding lately but will get back to it soon.

You are confusing the teleporting doors with the props/special entites like doors.

I am not confusing them I know most of the doors in the trigger files. Most doors can be set to locked or unlocked. I was just stating that I got the prop doors to work also. I am still trying to figure out how to set the roof top as a prop in free roam.

Offline Rambo7

  • "Awesomely Kick-Ass Troll"
  • Full Member
  • ***
  • Posts: 404
  • Gender: Male
  • #ZAMBess
    • View Profile
    • My ModDB Page
Re: Unlocking Doors [LUA]
« Reply #9 on: July 11, 2015, 11:21:09 PM »
For the "CLASS_MUSIC"
I had tried it already, but it didn't work
But it think the English/Maths/Geology Class is actually the same with the music class, but when I play the music class there is a different prop in the music class, any idea about this?

and for the observatory, I found this door, but somehow it can't open the door for the observatory
AreaSetDoorLocked("DT_observatory_doorL", false) -- Maybe this just the front gate, not the door for the observatory
AreaSetDoorLocked("observatory_doorR", false) --Not Working
AreaSetDoorLocked("DT_Observatory", false) --Not Working
Any Idea about this?

and I found some working doors, @soldier maybe u can add this to your first post too
AreaSetDoorLocked("ischool_Door25", false) --Roof Door (2nd floor), but after u climb the stair and reach the upper door and open it, it won't get u to the rooftop
AreaSetDoorLocked("DT_TINDUST_CHEMEX_DOOR", false) --Chem Plant Front Door (Outside/for enter the chem plant)
AreaSetDoorLocked("DT_ChemPlant_DoorL", false) --Chem Plant Front Door (Inside/for exit the chem plant)

Offline Unknownsoldier

  • Hero Member
  • ****
  • Posts: 2,773
    • View Profile
Re: Unlocking Doors [LUA]
« Reply #10 on: July 11, 2015, 11:35:14 PM »
AreaSetDoorLocked("DT_observatory_doorL", false) -- Maybe this just the front gate, not the door for the observatory
      TRIGGERNAME "ScGate_Observatory"
      AREACODE 0
      POSITION 30.158501, -134.052002, 2.796750
That is the gate. Gonna try yours DT_observatory_doorL as soon as i get home on my laptop.

EDIT: searched the observatoryL in trigger.img, and appears that was actually IN the observatory. I teleported to coords:


so seems interesting,
« Last Edit: July 11, 2015, 11:54:00 PM by Unknownsoldier »

deadpoolXYZ

  • Guest
Re: Unlocking Doors [LUA]
« Reply #11 on: July 12, 2015, 12:25:16 AM »
The doors inside the observatory don't teleport you outside when you open them, they work as normal doors like the ones in the preppies trophy room. Also they were never meant to be interacted with since there is a fence prop that blocks your way during Earnest boss fight.

About the outside door that's just an entity that can be opened, closed and even damaged but not like normal doors. It works in a similar way as other mission specific interactable props.

Offline Unknownsoldier

  • Hero Member
  • ****
  • Posts: 2,773
    • View Profile
Re: Unlocking Doors [LUA]
« Reply #12 on: July 12, 2015, 12:44:15 AM »
^Correct.

bully door test(unlisted)

I also discovered, that unlocking the observatory does NOT add a blip. But it takes away it's invulnerability, and you can destroy it. And that blip was custom spawned.

Offline gamerzod

  • Jr. Member
  • **
  • Posts: 17
    • View Profile
Re: Unlocking Doors [LUA]
« Reply #13 on: July 12, 2015, 11:11:58 AM »
^Correct.

bully door test(unlisted)
Can you explain, how can you do that, just like the video in the observatory?
you use warp?

Offline Unknownsoldier

  • Hero Member
  • ****
  • Posts: 2,773
    • View Profile
Re: Unlocking Doors [LUA]
« Reply #14 on: February 25, 2016, 05:16:35 AM »
i put a blip and when u go on it i made it prompt if u wanna enter

OH and ik this is a bump but i noticed something. SO FAR: the only ones working for me are the DT's with these perimeters: DT_areaname_doorL or something

like DT_gdorm_doorL these

NO i didnt spend months doing the same thing. i just tried it again.
« Last Edit: February 25, 2016, 05:23:15 AM by Unknownsoldier »