* *
Welcome, Guest. Please login or register.
Did you miss your activation email?
October 23, 2017, 02:05:36 AM

Login with username, password and session length

A question about backgrounds

  • 5 Replies
  • 629 Views
*

Offline Birnbaum

  • Jr. Member
  • **
  • 13
A question about backgrounds
« on: June 10, 2017, 08:45:21 PM »
I ´m planning to create some stages with effects for to move or change background or bglayers when the player reaches specific points on the level like these examples:

https://youtu.be/A3DDtLN-1PQ?t=14m52s

Between times 14m52s and 16m24s

The purple background changes horizontal direction to vertical when the player reaches the elevator, after kill the thugs the elevator stops and the background returns to horizontal direction and the player advance on the level.


https://youtu.be/lDbqyJJSJNo?t=4m57s
5m7s
Between times 4m57s and 5m07s the bridge explodes after player defeat thugs and the background changes the bridge image  to sewer entrance after player falls.

https://youtu.be/FX4Rf_DghKg?t=2m18s
Between times 2m18s and 2m29s the truck leaves warehouse and the background changes from static to a loop moving image.

My doubts are if these effects could be done on openbor.
If yes, I dont know how exactly it would be done but I have some ideas about.Maybe to try use levelscripts working on the level properties or something like entities under the main panel simulating effects for the background.
Could you give suggestions for how to solve this question?
Thanks in advance.
Follow the development of my MOD on Youtube:

https://www.youtube.com/channel/UCfrIVrWGuEf62CcMlwQoD8Q

*

Offline Damon Caskey

  • Administrator
  • Hero Member
  • *****
  • 1761
    • DC Current
Re: A question about backgrounds
« Reply #1 on: June 11, 2017, 01:45:36 AM »
They can. You don't always have to use level scripts depending on the situation. I'll try and give you some details Monday.
Projects in progress are now available here: https://github.com/DCurrent

*

Offline Bloodbane

  • Hero Member
  • *****
  • 3127
  • Dark Dragon
Re: A question about backgrounds
« Reply #2 on: June 11, 2017, 02:12:19 AM »
 I'm going to test some scripts to replicate the lift FX from Sonic Blastman video above. However, I can confirm that you can control horizontal bgspeed with script with this script:

Code: [Select]
      changelevelproperty("bgspeed", Speed);
 Set speed to any value you like
 I believe you can use same script to make truck leaving FX from Vendetta video

 As for destroyed bridge FX from Rushing Beat Ran video, IMO it's only graphical trick. When bright flash appeared in the background, I believe that's when long sewer bg image is spawned to cover bridge background. The FX when you think player is falling is actually the bridge pillar moving up
 For falling player FX, it can simply be done by running script to force player to play that animation

 I'll be back after I'm done with my tests :)

[Two days later]

 I'm back!! :D, back with good news

 I've found a simply and neat trick to make moving lift FX above. All you need is to set this code:

Code: [Select]
    changelevelproperty("vbgspeed", 1);
 Setting this with activate background autoscrolling and let it autoscroll vertically with speed of 1 i.e upwards
 To ensure bglayer and fglayer autoscroll together with background, make sure to set last parameter to 1 like this:

Quote
bglayer      data/bgs/elevatr2/back2.gif 0 -0.3 0 0 0 0 -1 -1 1 0 0 0 0 0 1
panel      data/bgs/elevatr2/plat2.gif
fglayer      data/bgs/elevatr2/front.png 10 0 -0.1 0 0 0 200 -1 -1 1 0 0 0 0 0 1

 Example of setting the code is this:

Quote
wait
at   1000

group   1 1
at   0

spawn   delay
@script
  void main()
  {
    changelevelproperty("vbgspeed", 1);
  }
@end_script
health  20
coords   160 190
at   0

group   2 2
at   0

spawn   Caine
map   3
coords   400 190
at   0

spawn   Caine
map   3
coords   -80 190
at   0

group   1 1
at   0

spawn   delay
@script
  void main()
  {
    changelevelproperty("vbgspeed", 0);
  }
@end_script
health  20
coords   160 190
at   0

group   100 100
at   0

 After wait is activated at scrollpos 1000, background is autoscrolled then 2 Caines spawns. After both are defeated, background will stop autoscrolling and wait ends

 You can change the script with this:

Code: [Select]
    changelevelproperty("bgspeed", 1);
 to autoscroll horizontally. Use similar script to stop the autoscroll :)
« Last Edit: June 13, 2017, 12:59:23 AM by Bloodbane »

*

Offline Birnbaum

  • Jr. Member
  • **
  • 13
Re: A question about backgrounds
« Reply #3 on: June 13, 2017, 06:49:01 PM »
Thank you so much for your help, Bloodbane!
I will try to use this code on a FX for  the engines turning on/off with a little quake.


 
« Last Edit: June 13, 2017, 09:50:03 PM by Birnbaum »
Follow the development of my MOD on Youtube:

https://www.youtube.com/channel/UCfrIVrWGuEf62CcMlwQoD8Q

*

Offline BeasTie

  • Hero Member
  • *****
  • 2460
Re: A question about backgrounds
« Reply #4 on: June 16, 2017, 08:55:42 PM »
We've tried before and you can't seem to control level rocking via script.

*

Offline Birnbaum

  • Jr. Member
  • **
  • 13
Re: A question about backgrounds
« Reply #5 on: June 19, 2017, 11:45:47 AM »
We've tried before and you can't seem to control level rocking via script.
Ok.
I´m a rookie on Openbor so I dont know exactly what can be done or not  with scripts.
Thanks again.
« Last Edit: June 19, 2017, 11:54:46 AM by Birnbaum »
Follow the development of my MOD on Youtube:

https://www.youtube.com/channel/UCfrIVrWGuEf62CcMlwQoD8Q

 

Recent

Members
Stats
  • Total Posts: 46581
  • Total Topics: 3192
  • Online Today: 33
  • Online Ever: 316
  • (January 04, 2013, 09:43:02 AM)
Users Online
Users: 1
Guests: 25
Total: 26