Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #423: setRadioChannel doesn't work when outside a vehicle #753

Closed
wants to merge 6 commits into from
Closed

Fix #423: setRadioChannel doesn't work when outside a vehicle #753

wants to merge 6 commits into from

Conversation

patrikjuvonen
Copy link
Contributor

@patrikjuvonen patrikjuvonen commented Jan 3, 2019

Fixes an issue where setRadioChannel function doesn't work on first try. You will have to enter a car or initialize an ambient track such as a stadium interior radio. This PR will initialize the ambience track manager by calling its Service method. It appears to fix the issue.

Feel free to comment on what should be done instead, this is my first time working with asm injection stuff.

@patrikjuvonen patrikjuvonen added the bug Something isn't working label Jan 3, 2019
@qaisjp
Copy link
Contributor

qaisjp commented Jan 4, 2019

Unfortunately I can't reproduce a fix using your patch (i.e your patch does not fix anything). I am using a stripped radio version of GTASA, though. I'll try and re-test with full radio.

Interestingly, both before and after applying this patch, the following problem occurs:

setRadioChannel breaks stadium audio

  1. Start game afresh, and join server
  2. crun setRadioChannel(9) (this does not work, except that the radio plays for like 250ms)
  3. Go to a stadium and observe that the regular stadium audio does not work. normally it does play - this only happens because you tried crun setRadioChannel(9). (note that this also happens in other audio interiors, like the shamal)
  4. go to "outside", try to play radio, and note that step 2 still occurs
  5. go back to the stadium and note that step 3 still occurs
  6. spawn a vehicle in the stadium
  7. when you click enter, the audio will work again
  8. leave the vehicle, go "outside", and now crun setRadioChannel(9) will work

@patrikjuvonen
Copy link
Contributor Author

Thanks for testing. There appears to be two issues, the latter being that once you start the radio (call to StartRadio), it will keep the radio on until you manually turn it off. I could try making it so that once you enter an area with an ambience track, it will stop the radio automatically and hence enables the ambience track. The fact that the radio doesn't turn on is weird, I'll test around a bit more. Where did you spawn? Is it the Steam version or some other version? I'm wondering if this has to do with some wrong offsets like with the radio class we had to do some tweaking.

@qaisjp
Copy link
Contributor

qaisjp commented Jan 4, 2019

Is it the Steam version or some other version?

b0cf9fb580ff473b1fdefc7b7617059d *gta_sa.exe I think it's nocd 1.0

Where did you spawn?

Happens with play's pirate ship spawn, as well as Easter Bay Airport in San Fierro.

@qaisjp
Copy link
Contributor

qaisjp commented Jan 4, 2019

Adding back the radio music to the streams folder makes this patch work. Do you think you can still fix it when you have no music?

To remove radio make sure your audio/streams folder looks like this:

image

qaisjp
qaisjp previously approved these changes Jan 4, 2019
Copy link
Contributor

@qaisjp qaisjp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs secondary review from @multitheftauto/blue-collaborators

@qaisjp qaisjp dismissed their stale review January 4, 2019 19:18

Scratch that - it still doesn't work reliably, even with regular music. I don't know why it did work that one time. Can anyone else reproduce this?

@patrikjuvonen
Copy link
Contributor Author

Odd, I can't seem to reproduce that issue even without those files.

@patrikjuvonen patrikjuvonen changed the title Fix #423: setRadioChannel doesn't work when outside a vehicle WIP: Fix #423: setRadioChannel doesn't work when outside a vehicle Feb 22, 2019
@botder botder added this to the Backlog milestone Mar 4, 2019
@qaisjp qaisjp marked this pull request as draft April 9, 2020 16:10
@qaisjp qaisjp changed the title WIP: Fix #423: setRadioChannel doesn't work when outside a vehicle Fix #423: setRadioChannel doesn't work when outside a vehicle Apr 9, 2020
@patrikjuvonen patrikjuvonen linked an issue Apr 13, 2020 that may be closed by this pull request
@patrikjuvonen patrikjuvonen removed this from the Backlog milestone Apr 13, 2020
@patrikjuvonen
Copy link
Contributor Author

I am no longer committed to working this issue so I'm closing this PR. Hopefully some of the work could be of use to someone else in the future.

@patrikjuvonen patrikjuvonen deleted the github-issue-423 branch April 13, 2020 20:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

setRadioChannel doesn't work when outside a vehicle
3 participants