May 09, 2021, 12:17:23 pm

The Gang Garrison 2 Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

NOTICE: Due to a rise in bot activity, new posters need to be approved before posting.

Join the community Discord server!

Poll

Should I add the default backgrounds to the list?

Yes, all of them (MenuBackground1, 2 and 3)
- 2 (100%)
Yes, but only MenuBackground2
- 0 (0%)
Yes, but without MenuBackground3 (unused default for various reasons)
- 0 (0%)
No
- 0 (0%)

Total Members Voted: 2

Voting closed: April 29, 2017, 09:57:25 am


Pages: [1]

Author Topic: [Client-Side] Random Backgrounds 1.2  (Read 1205 times)

PrOF

  • Full Member
  • ***
  • Karma: 43
  • Offline Offline
  • Posts: 594
  • Sometimes a dev. Only sometimes
[Client-Side] Random Backgrounds 1.2
« on: April 14, 2017, 06:48:16 am »

Do I even need to explain this?

Most of the background makers I found in http://www.ganggarrison.com/forums/index.php?topic=34573 are no longer active, should I keep their backgrounds in the plugin?

As for the ones still active, GOOD JOB on these backgrounds, if you want to, I'll remove them from the zip
 :x9:

(click to show/hide)

Poll: should I add also the three default backgrounds?
« Last Edit: August 29, 2017, 01:30:35 am by PrOF »
Logged

Fuzion

  • Lucky Member
  • *******
  • Karma: 22
  • Offline Offline
  • Posts: 922
  • Blind asian.
Re: [Client-Side] Random Backgrounds version MEH.0
« Reply #1 on: April 14, 2017, 11:27:45 am »

So, if I were to make my own background, will it get displayed on the menu?
Logged

PrOF

  • Full Member
  • ***
  • Karma: 43
  • Offline Offline
  • Posts: 594
  • Sometimes a dev. Only sometimes
Re: [Client-Side] Random Backgrounds version MEH.0
« Reply #2 on: April 14, 2017, 11:31:50 am »

So, if I were to make my own background, will it get displayed on the menu?
Yeah, I'll have to add it to the list and it will be randomly selected between the others :z6:
Logged

Spazz

  • Seasoned Member
  • *****
  • Karma: 44
  • Offline Offline
  • Posts: 1933
  • Almost too much seasoning.
Re: [Client-Side] Random Backgrounds version MEH.0
« Reply #3 on: April 14, 2017, 11:33:12 am »

The point of Menu backgrounds were the winners of the Haxxy comps...
Logged

<3 Bustatunez

PrOF

  • Full Member
  • ***
  • Karma: 43
  • Offline Offline
  • Posts: 594
  • Sometimes a dev. Only sometimes
Re: [Client-Side] Random Backgrounds version MEH.0
« Reply #4 on: April 14, 2017, 11:35:30 am »

The point of Menu backgrounds were the winners of the Haxxy comps...
Hey the more backgrounds the better, I'll look up some more but it can always be customized, it isn't a complicated plugin
Do you have some suggestions?
Logged

PrOF

  • Full Member
  • ***
  • Karma: 43
  • Offline Offline
  • Posts: 594
  • Sometimes a dev. Only sometimes
Re: [Client-Side] Random Backgrounds version 1.1
« Reply #5 on: April 14, 2017, 01:33:31 pm »

Update 1.1
-Gave credit where credit is due in the main menu
-Added a really cool bug that I don't know how to fix, see you in the incompetent's cry for help
Logged

[FR]YB

  • 2013 Haxxy Award Winner
  • *
  • Karma: 28
  • Offline Offline
  • Posts: 642
  • There are 11 people playing holy sh
Re: [Client-Side] Random Backgrounds version 1.1
« Reply #6 on: April 14, 2017, 02:35:52 pm »

I downloaded and unzipped the archive in my Plugins folder.

Code: [Select]
___________________________________________
ERROR in
action number 1
of Draw Event
for object MainMenuController:

Trying to draw non-existing background.
Happens after splash screen.
Fixed by moving the PrOF folder into Resources. (The original zip contained the plugin script and a PrOF folder, but it should have contained the script and a Resources folder which would have contained the PrOF folder)



You should probably still explain your bug in this thread.
So, when the game starts it correctly changes background, but shows "Aftermath" by Natsu

Also, I just checked and it does work correctly (the caption) when you go back to the main menu (i.e. go to any menu, then go back to main menu)


Oh boi, I found it. It's the DevMessageChecker.
It fires a http request when it's created, to get data like the latest version, the changelog... and the background info.
The thing is, the DevMessageChecker is created AFTER the MainMenuController runs its ev_user1. So your custom MainMenuController changes the backgroundTitle, all is well, but then when the http response for the DevMessageChecker comes, your backgroundTitle gets updated, and the MainMenuController is never called back!

See on github

You could hack around it by forcing your backgroundTitle in a step event. I wouldn't rely on an alarm, because http request times may vary a lot depending on internet speed, stability and availability.
« Last Edit: April 14, 2017, 02:37:22 pm by [FR]YB »
Logged

PrOF

  • Full Member
  • ***
  • Karma: 43
  • Offline Offline
  • Posts: 594
  • Sometimes a dev. Only sometimes
Re: [Client-Side] Random Backgrounds version 1.1
« Reply #7 on: April 14, 2017, 02:38:13 pm »

I downloaded and unzipped the archive in my Plugins folder.

Code: [Select]
___________________________________________
ERROR in
action number 1
of Draw Event
for object MainMenuController:

Trying to draw non-existing background.
Happens after splash screen.
Fixed by moving the PrOF folder into Resources. (The original zip contained the plugin script and a PrOF folder, but it should have contained the script and a Resources folder which would have contained the PrOF folder)



You should probably still explain your bug in this thread.
So, when the game starts it correctly changes background, but shows "Aftermath" by Natsu

Also, I just checked and it does work correctly (the caption) when you go back to the main menu (i.e. go to any menu, then go back to main menu)


Oh boi, I found it. It's the DevMessageChecker.
It fires a http request when it's created, to get data like the latest version, the changelog... and the background info.
The thing is, the DevMessageChecker is created AFTER the MainMenuController runs its ev_user1. So your custom MainMenuController changes the backgroundTitle, all is well, but then when the http response for the DevMessageChecker comes, your backgroundTitle gets updated, and the MainMenuController is never called back!

See on github

You could hack around it by forcing your backgroundTitle in a step event. I wouldn't rely on an alarm, because http request times may vary a lot depending on internet speed, stability and availability.
Thanks a lot YB, awesome as always :ubermench:
Logged

PrOF

  • Full Member
  • ***
  • Karma: 43
  • Offline Offline
  • Posts: 594
  • Sometimes a dev. Only sometimes
Re: [Client-Side] Random Backgrounds 1.2
« Reply #8 on: May 19, 2017, 01:36:42 pm »

(click to show/hide)
« Last Edit: January 27, 2019, 04:15:33 am by PrOF »
Logged

PrOF

  • Full Member
  • ***
  • Karma: 43
  • Offline Offline
  • Posts: 594
  • Sometimes a dev. Only sometimes
Re: [Client-Side] Random Backgrounds 1.2
« Reply #9 on: August 29, 2017, 01:27:52 am »

Small update: now the game chooses a background only once per session, previously navigating the main menu would be annoying
Logged
Pages: [1]
 

Page created in 0.032 seconds with 39 queries.