Rejected zak bad code thread

Zak

Resident xenophile
Joined
Apr 26, 2016
Messages
5,887
Nebulae
16,124
also this isn't really relevant to coding in any way but fuck it, this is my thread so i make the rules

I finally figured out how
they managed to do the time travel sequences during the level "Effect and Cause".

Since it uses the Source engine, it was bugging me really badly, since although it is a heavily modified version it's still the same engine at its core. After enough digging through unpacked VPK files, wild speculation, and even trying to decompile maps manually by opening them in a text editor, I finally discovered it (or, at least, came up with a reasonable hypothesis) by simple trial-and-error and looking in the right place at the right time.



If you look closely, you'll see a seemingly random duplicate nametag. Whenever you make the time switch, the nametag's location alternates between being in the ceiling and the floor. Given the few random AI quirks that the level has, along with a few noticeable bugs (grenades thrown before switching timeline don't follow the same laws of time as the enemies, detonating satchel charges while in the opposite timeline will still produce an explosion effect upon returning quickly enough but do no damage, etc) has led me to a conclusion so simple that I'm amazed I haven't thought of it further.

It's just two almost-identical copies of the level stacked on top of each other.

Switching timelines simply translates your position some pre-defined distance along the Z-axis, say 8,000 units or so. All the enemies in the new timeline are spawned/re-enabled, and enemies in the old timeline have their AI disabled. When switching timelines back to the opposite one, it disables the AI in the timeline you're leaving, and re-enables the AI for the enemies in your new timeline. There's also some extra coding trickery involved behind the scenes to ensure you don't time travel into a wall, but I've finally figured out the main method of how they do it.


I'm way more proud of myself than I should be.
 
Reactions: List

Deadpool

A turtle made it to the water
Joined
Apr 26, 2016
Messages
1,007
Nebulae
2,265
also this isn't really relevant to coding in any way but fuck it, this is my thread so i make the rules

I finally figured out how
they managed to do the time travel sequences during the level "Effect and Cause".

Since it uses the Source engine, it was bugging me really badly, since although it is a heavily modified version it's still the same engine at its core. After enough digging through unpacked VPK files, wild speculation, and even trying to decompile maps manually by opening them in a text editor, I finally discovered it (or, at least, came up with a reasonable hypothesis) by simple trial-and-error and looking in the right place at the right time.



If you look closely, you'll see a seemingly random duplicate nametag. Whenever you make the time switch, the nametag's location alternates between being in the ceiling and the floor. Given the few random AI quirks that the level has, along with a few noticeable bugs (grenades thrown before switching timeline don't follow the same laws of time as the enemies, detonating satchel charges while in the opposite timeline will still produce an explosion effect upon returning quickly enough but do no damage, etc) has led me to a conclusion so simple that I'm amazed I haven't thought of it further.

It's just two almost-identical copies of the level stacked on top of each other.

Switching timelines simply translates your position some pre-defined distance along the Z-axis, say 8,000 units or so. All the enemies in the new timeline are spawned/re-enabled, and enemies in the old timeline have their AI disabled. When switching timelines back to the opposite one, it disables the AI in the timeline you're leaving, and re-enables the AI for the enemies in your new timeline. There's also some extra coding trickery involved behind the scenes to ensure you don't time travel into a wall, but I've finally figured out the main method of how they do it.


I'm way more proud of myself than I should be.

i loved that level as well, tbh titanfall 2 is an underrated game man, but that's what it gets for a release that was really close to bf1 and infinite warfare
 
Reactions: List

Zak

Resident xenophile
Joined
Apr 26, 2016
Messages
5,887
Nebulae
16,124
i loved that level as well, tbh titanfall 2 is an underrated game man, but that's what it gets for a release that was really close to bf1 and infinite warfare
playercount has actually been gradually increasing since launch according to some statistics, plus with all the free dlc and updates they've been releasing it's starting to draw a lot more people in

here's hoping it's one of those games that kinda gets fucked over on release but gets popular afterwards
 
Reactions: List

Deadpool

A turtle made it to the water
Joined
Apr 26, 2016
Messages
1,007
Nebulae
2,265
playercount has actually been gradually increasing since launch according to some statistics, plus with all the free dlc and updates they've been releasing it's starting to draw a lot more people in

here's hoping it's one of those games that kinda gets fucked over on release but gets popular afterwards
yeah it's kind of awesome how all the new maps and dlcs are free, kind of a surprise that EA didn't make the devs release some season pass or something (looking at you battlefield 1)
 
Reactions: List

overki11

Electron
Joined
Apr 30, 2016
Messages
545
Nebulae
137
people should stop asking for more food/drink items

  • 95% of the playerbase don't roleplay eating
  • 30ish% of the playerbase never eat or drink and ignore the bars
  • 0% of the playerbase (@Blackquill is an exception) has ever thanked me for adding or rewriting any food items in the past
It's not worth the time and effort, honestly.
"time and effort" lmao it takes like two seconds

you slap a model path down, and change the name and description in the script file, done.

EDIT: Dumb but true
 
Last edited:
Reactions: List

Warwick

Mum Looks Like Tracy Beaker
GTA RP Playtester
Joined
Apr 26, 2016
Messages
2,470
Nebulae
6,039
"time and effort" lmao it takes like two seconds

you slap a model path down, and change the name and description in the script file, done.
Actually, you need:
  • Name
  • Description
  • Model
  • Category
  • Hunger Variable Increase
  • Thirst Variable Increase
  • Cost in Business Menu
  • Availability in Business Menu
  • Associated Business Menu Flag
  • Crafting Recipes (Which are separate)
  • Whether or not the item adds the drunkenness effect.
  • Attribute Effects

That, for thirty to forty scripts, can take a fucking long time, especially when the descriptions on items were as comprehensive as I used to make them.

edit: dumb but true xd
 

MaXenzie

Sexually attracted to robots
Media Developer
GTA RP Playtester
Joined
Apr 26, 2016
Messages
17,277
Nebulae
24,628
Actually, you need:
  • Name
  • Description
  • Model
  • Category
  • Hunger Variable Increase
  • Thirst Variable Increase
  • Cost in Business Menu
  • Availability in Business Menu
  • Associated Business Menu Flag
  • Crafting Recipes (Which are separate)
  • Whether or not the item adds the drunkenness effect.
  • Attribute Effects

That, for thirty to forty scripts, can take a fucking long time, especially when the descriptions on items were as comprehensive as I used to make them.

Which is why you're the best.

:cool:
 

overki11

Electron
Joined
Apr 30, 2016
Messages
545
Nebulae
137
Actually, you need:
  • Name
  • Description
  • Model
  • Category
  • Hunger Variable Increase
  • Thirst Variable Increase
  • Cost in Business Menu
  • Availability in Business Menu
  • Associated Business Menu Flag
  • Crafting Recipes (Which are separate)
  • Whether or not the item adds the drunkenness effect.
  • Attribute Effects

That, for thirty to forty scripts, can take a fucking long time, especially when the descriptions on items were as comprehensive as I used to make them.
wooooow that takes forever i bet

copying and pasting similar items and changing a few variables
 
Reactions: List

cns - he/him/his

The Winner
Joined
Apr 26, 2016
Messages
23,638
Nebulae
65,342
"time and effort" lmao it takes like two seconds

you slap a model path down, and change the name and description in the script file, done.

EDIT: Dumb but true
lol we dont even need more custom made items when an sa can just make them with custom item/food/whatever its called
 

MaXenzie

Sexually attracted to robots
Media Developer
GTA RP Playtester
Joined
Apr 26, 2016
Messages
17,277
Nebulae
24,628
i would do it but then again i don't exactly have access to the server files, do i?

telling people its hard to make new script items is really just you being lazy

hole.jpg
 
Reactions: List

Warwick

Mum Looks Like Tracy Beaker
GTA RP Playtester
Joined
Apr 26, 2016
Messages
2,470
Nebulae
6,039
i don't exactly have access to the server files, do i?
Neither do I, and I never have.
telling people its hard to make new script items is really just you being lazy
I never said it's hard, I said it's time consuming. If you think you're so good, get the item skeleton from a dev, and write some scripts. :)
 
Reactions: List

overki11

Electron
Joined
Apr 30, 2016
Messages
545
Nebulae
137
he isnt staff and i could get the format right now if you wanna write up some scripts
i'll write you boys up some scripts, i need:
full item syntax
list of existing items
list of flags
syntax for recipes
and any other related stuff i might need for writing items