Submit Your Article


 
RPG Maker

Welcome Guest ( Log In | Register )


  Games Resources RPG Maker VX RPG Maker XP Scripts Tutorials Downloads

3 Pages V   1 2 3 >  
Reply to this topicStart new topic
> Mode7 VX
painhurt
post Jan 6 2009, 06:10 PM
Post #1


Level 3
Group Icon

Group: Member
Posts: 42
Type: Event Designer
RM Skill: Intermediate




Mode7 VX
From 2chan


Introduction

Adds 3D like functionality while riding an Airship.

Screenshots



How To Use

Plug and Play. Place the scripts in the demo above 'Main, but you have to import the 'bg.png' file included in the demo to your project's 'Graphic/Pictures' folder.

To activate mode7 anywhere on the map, make a call script command with this '$game_map.mode3D = true'.

Read my post here on how to change the angle of incidence (lolwut).

Demo

DOWNLOAD

Compatibility/Known Bugs
-Any other visible events (those with graphics) will offset in the map while in Mode7.

Credit and Thanks
-RGSS2 scripters at 2chan for letting me post this.

Author's Notes
This is a basic Mode7 script. Unlike it XP counterparts (Neo Mode7, among others), it doesn't include rotation/zoom/tilt/ functions.

And also,

I suck at scripting.

This post has been edited by painhurt: Jan 10 2009, 03:43 PM


__________________________
Don't be like me! Backup your projects!!
Go to the top of the page
 
+Quote Post
   
karu89
post Jan 6 2009, 06:17 PM
Post #2


Level 4
Group Icon

Group: Member
Posts: 45
Type: Event Designer
RM Skill: Beginner




i actually was looking for a script like this I will be using it and give credit to you, now i just need my game to work sad.gif
Go to the top of the page
 
+Quote Post
   
Silverelick
post Jan 6 2009, 06:52 PM
Post #3


Level 2
Group Icon

Group: Member
Posts: 21
Type: Event Designer
RM Skill: Intermediate




1 you need the Image from the Demo 2 I was looking for something like this http://www.youtube.com/watch?v=6RRF5KGseek
.


__________________________
Hey Friends and I are make a Legend of Zelda Anime check are Channel out http://www.youtube.com/project4swordsSE
Go to the top of the page
 
+Quote Post
   
painhurt
post Jan 6 2009, 07:25 PM
Post #4


Level 3
Group Icon

Group: Member
Posts: 42
Type: Event Designer
RM Skill: Intermediate




QUOTE (Silverelick @ Jan 6 2009, 06:52 PM) *
1 you need the Image from the Demo 2 I was looking for something like this http://www.youtube.com/watch?v=6RRF5KGseek
.


1.I don't comprehend what you are saying. Really.

2.I believe for that, you have to specify terrain tags for tilesets for objects to drawn verticaly (i.e not rendered into the map). Unfortunately VX doesnt support terrain tags (no wait, i think it is, via scripts, but like i said, this is a basic Mode7 script).


__________________________
Don't be like me! Backup your projects!!
Go to the top of the page
 
+Quote Post
   
Hunter EX
post Jan 6 2009, 07:44 PM
Post #5


Randomee Extravanee
Group Icon

Group: Revolutionary
Posts: 432
Type: Developer
RM Skill: Skilled




Actually, the objects stick up because they're events. If they were simply added as a layer on the map, they'd be as flat as the maps themselves. Hope this clears things up. smile.gif


__________________________
Map Making: It may take me alittle while, but I can make maps with a decent amount of detail.
Coding: Alright, i'll be honest here; I can't code worth a crap, at least script-wise. At least the stuff in Rm2k/3 could be done using proper common sense. >.>;;
Artist: I can be pretty decent, nothing stellar. I also suck at proper shading.
Opinions: I'm a rather blunt and rude person in this regard - i'll tell you the problems, flatout, then tell you the good points, if any, that I see. =/

Super Smash Bros. Brawl Friend Code: 0645-7909-5917
Xbox Live Gamertag: RikohEX
Go to the top of the page
 
+Quote Post
   
painhurt
post Jan 6 2009, 08:16 PM
Post #6


Level 3
Group Icon

Group: Member
Posts: 42
Type: Event Designer
RM Skill: Intermediate




QUOTE (Hunter EX @ Jan 6 2009, 07:44 PM) *
Actually, the objects stick up because they're events. If they were simply added as a layer on the map, they'd be as flat as the maps themselves. Hope this clears things up. smile.gif



No, im certain the Mode7 in the video uses terrain tags. I have a copy of it. Actually, you can use events in this script to make it 'stick out.

Like this:



But if you walk around with it...



This script doesnt apply depth for events.




__________________________
Don't be like me! Backup your projects!!
Go to the top of the page
 
+Quote Post
   
miget man12
post Jan 6 2009, 08:50 PM
Post #7


Making a Comeback
Group Icon

Group: Revolutionary
Posts: 393
Type: Musician
RM Skill: Intermediate




Would it be possible to make it so a certain map uses mode7 while walking? instead of just an airship...? Other that that, great script! Does credit go to you? if not, who?


__________________________
By the way:


I'm bored because it's summer so I decided to drop by for a bit.
Go to the top of the page
 
+Quote Post
   
Chronno
post Jan 6 2009, 08:55 PM
Post #8


Level 5
Group Icon

Group: Member
Posts: 64
Type: None
RM Skill: Undisclosed




you could make a event in with a call script with this code: $game_map.mode3D = true
that maybe works
Go to the top of the page
 
+Quote Post
   
painhurt
post Jan 6 2009, 09:08 PM
Post #9


Level 3
Group Icon

Group: Member
Posts: 42
Type: Event Designer
RM Skill: Intermediate




QUOTE (miget man12 @ Jan 6 2009, 08:50 PM) *
Would it be possible to make it so a certain map uses mode7 while walking? instead of just an airship...? Other that that, great script! Does credit go to you? if not, who?


Do credit '2chan RGSS2 Scripters' but of course it would be nice if you also credit me. tongue.gif

QUOTE (Chronno @ Jan 6 2009, 08:55 PM) *
you could make a event in with a call script with this code: $game_map.mode3D = true
that maybe works


Correct.


__________________________
Don't be like me! Backup your projects!!
Go to the top of the page
 
+Quote Post
   
PhantomH
post Jan 6 2009, 09:43 PM
Post #10


Ushiromiya Battler
Group Icon

Group: Revolutionary
Posts: 758
Type: Writer
RM Skill: Skilled




Anyone know how to change how much the surface curves? It'd be really nice to know.


__________________________
Go to the top of the page
 
+Quote Post
   
painhurt
post Jan 7 2009, 03:08 AM
Post #11


Level 3
Group Icon

Group: Member
Posts: 42
Type: Event Designer
RM Skill: Intermediate




QUOTE (PhantomH @ Jan 6 2009, 09:43 PM) *
Anyone know how to change how much the surface curves? It'd be really nice to know.



In TIleSprite, go to line 287 and you'll find this.

CODE
$game_map.set_angle(90 - (45 / 8 * (@altitude / 4 + 1)))


Change the value 45 to 90 - the angle you want, for instance i want an angle of 70 that would be 90-70 = 20

hence,

CODE
$game_map.set_angle(90 - (20 / 8 * (@altitude / 4 + 1)))


Another change, go to line 293.

CODE
@altitude == MAX_ALTITUDE ? $game_map.set_angle(45): set_angle


Change the $game_map.set_angle value it to the angle you want i.e 70.

hence,

CODE
@altitude == MAX_ALTITUDE ? $game_map.set_angle(70): set_angle





__________________________
Don't be like me! Backup your projects!!
Go to the top of the page
 
+Quote Post
   
JoaoB
post Jan 7 2009, 09:40 AM
Post #12


Level 1
Group Icon

Group: Member
Posts: 10
Type: Scripter
RM Skill: Intermediate




Can I publish this script in other forums?


__________________________
A skilled scripter presenting itself to the biggest Maker community in the world.

Go to the top of the page
 
+Quote Post
   
PhantomH
post Jan 7 2009, 03:07 PM
Post #13


Ushiromiya Battler
Group Icon

Group: Revolutionary
Posts: 758
Type: Writer
RM Skill: Skilled




Thanks pain smile.gif . I'll be sure to credit you for the help.

QUOTE (JoaoB @ Jan 7 2009, 09:40 AM) *
Can I publish this script in other forums?


You'll need to get permission from the original scripters. There's a link to their site in the credits.

EDIT: Hm, your instructions only works for the airship. I was hoping we could get one for walking since my game won't be using airships :| .


__________________________
Go to the top of the page
 
+Quote Post
   
miget man12
post Jan 7 2009, 04:47 PM
Post #14


Making a Comeback
Group Icon

Group: Revolutionary
Posts: 393
Type: Musician
RM Skill: Intermediate




For walking with the Mode7 effect refer to Chronno's Post:
QUOTE (Chronno @ Jan 6 2009, 09:55 PM) *
you could make a event in with a call script with this code: $game_map.mode3D = true
that maybe works

Thanks Chronno!


__________________________
By the way:


I'm bored because it's summer so I decided to drop by for a bit.
Go to the top of the page
 
+Quote Post
   
painhurt
post Jan 7 2009, 05:41 PM
Post #15


Level 3
Group Icon

Group: Member
Posts: 42
Type: Event Designer
RM Skill: Intermediate




QUOTE (JoaoB @ Jan 7 2009, 09:40 AM) *
Can I publish this script in other forums?



Feel welcome to post to other forums, But do give credit to 1. 2chan RGSS2 Scripters and 2. Painhurt.



__________________________
Don't be like me! Backup your projects!!
Go to the top of the page
 
+Quote Post
   
chorrol
post Jan 8 2009, 11:43 AM
Post #16


Level 3
Group Icon

Group: Member
Posts: 39
Type: Event Designer
RM Skill: Advanced




Really cool script, i WILL use this in my game! biggrin.gif
Go to the top of the page
 
+Quote Post
   
Genshyu
post Jan 8 2009, 12:36 PM
Post #17


Level 8
Group Icon

Group: Revolutionary
Posts: 118
Type: Scripter
RM Skill: Intermediate




Hmm, if only you could make this where you could walk around like this, that would be Freakin sweet.


__________________________
My current Scripts.

[Show/Hide] Save / Load Scripts.



Things I am currently Learning:
RGSS2.
If you use a script you don't have to give credit :D I'm nice like that. However, if you wan't to give credit then Give Credit to Craig Ramsey.
Go to the top of the page
 
+Quote Post
   
Dusk noun
post Jan 8 2009, 01:40 PM
Post #18


Level 4
Group Icon

Group: Member
Posts: 51
Type: Developer
RM Skill: Skilled




Well it's a very requested for VX script. But it needs to be emproved

And you CAN make it work always but i'm not agree with the method. Yes, if you make a script call with "$game_map.mode3D = true" it turns on, but once you get on an airship, the angle sets again so you a return to 2-D and then again to conic perspective. And once you get off, the variable turns to false, so it turns off (not when you get off an airship, actually, it's when the altitude is 0 but it has the same effect). A scripter can solve that but here there are people that don't want to edit the scripts or don't know how to edit them. So to make that way work ever. you need that code to be updated everytime you get off an airship. To avoid that i've made an "alternative" TileSprite script taking out those effects. So if you want the game to be always in conic perspective, replace the whole code of the TileSprite script with this one.


[Show/Hide] Always Conic perspective Code
class TileSprite < Sprite
def initialize(width, height, tilemap, viewport)
super(viewport)
self.bitmap = Bitmap.new(Game::DISPLAY_WIDTH, Game::DISPLAY_HEIGHT)
self.x = 0
self.y = 0
self.ox = 0
self.oy = 0
self.z = 0
@backbuffer = TileBitmap.new(width, height, tilemap)
@bg = Sprite.new(viewport)
@bg.z = 1
@bg.blend_type = 1
@bg.bitmap = Cache.picture('bg')

@mapx = -999
@mapy = -999

@x_plus = (width - Game::DISPLAY_WIDTH) / 2
@y_plus = 128 #(height - Game::DISPLAY_HEIGHT) / 2

@draw_count = false

@x_table = Table.new(416)
@y_table = Table.new(416)
set_render_table(45)
end

def dispose
@bg.dispose if @bg
@backbuffer.dispose if @backbuffer
self.bitmap.dispose if self.bitmap
super
end

def hide
self.visible = false
@bg.visible = false
end

def show
self.visible = true
@bg.visible = true
end


def set_render_table(angle)
return false if angle == @angle
@angle = angle
d = 400.0
rad = angle * Math:tongue.gifI / 180
sina = Math.sin(rad)
cosa = Math.cos(rad)

x_zoom = 272 * 1.5
for i in 0...416

sy = 208 - i

unless angle == 90
aaa = sy == 0 ? 0: (90 - angle) / 208.0 * sy
aaa = sy < 0 ? 90 + aaa : 90 - aaa
rad = aaa * Math:tongue.gifI / 180
sy = (sy / Math.sin(rad)) * (d + (sy * Math.cos(rad))) / d
end


to_y = sina.zero? ? -256: ((sy / sina) * (d + (sy * cosa)) / d).round
#to_y = sina.zero? ? -256: ((sy / sina) * (d + (sy * cosa)) / d).round
@y_table[i] = 208 - to_y

#y=1のときのx
to_x = (-x_zoom * (d + (sy * -cosa)) / d) + x_zoom
@x_table[i] = - (272 * to_x / (272 - to_x )).round
end

#一応bgのサイズもかえとく
#90が0で45が100
case @angle
when 45
@bg.zoom_y = 1.0
when 90
@bg.zoom_y = 0.0
else
@bg.zoom_y = (1.0 / 45) * (90 - @angle)
end
@bg.opacity = 255 * @bg.zoom_y
return true
end



#マップ上の座標で設定
def update_map(ox, oy)
return unless self.visible

aox = ($game_map.display_x >> 3 & 31) + @x_plus
aoy = ($game_map.display_y >> 3 & 31) + @y_plus

ud = set_render_table($game_map.get_angle)
sd = @backbuffer.set_map(ox, oy)
return if !sd && !ud && aox == @mapx && aoy == @mapy
update_bitmap(aox, aoy)
end

def update_bitmap(aox, aoy)
@mapx = aox
@mapy = aoy

unless aox == @x_plus && aoy == @y_plus
@draw_count = !@draw_count
return if @draw_count
end

bmp = self.bitmap
bmp.clear

bmph = bmp.height
bmpw = bmp.width

yt = @y_table
xt = @x_table
bb = @backbuffer
from_r = Rect.new(0, 0, 1 , 1)
to_r = Rect.new(0, 0, bmpw, 1)
i = 0
while i < bmph
to_y = yt[i]
if to_y < -@y_plus
i += 1
next
end

to_x = xt[i]
to_r.y = i

ww = 0
while i < bmph
ww += 1
i += 1
break unless to_x == xt[i] && to_y + ww == yt[i]
end


to_r.height = ww
from_r.set(to_x + aox, to_y + aoy, bmpw - to_x - to_x, ww)
bmp.stretch_blt(to_r, bb, from_r)
end
end


end

class Game_Map
#--------------------------------------------------------------------------
# ● 公開インスタンス変数
#--------------------------------------------------------------------------
attr_accessor :mode3D

#--------------------------------------------------------------------------
# ● オブジェクト初期化
#--------------------------------------------------------------------------
alias a9_003_initialize initialize
def initialize
a9_003_initialize
@mode3D = true
@angle3D = 45
end

#--------------------------------------------------------------------------
def set_angle(v)
@angle3D = v
end

#--------------------------------------------------------------------------
def get_angle
@angle3D
end

end

class Spriteset_Map

#--------------------------------------------------------------------------
# ● ビューポートの作成
#--------------------------------------------------------------------------
alias a9_003_create_viewports create_viewports
def create_viewports
a9_003_create_viewports
@viewport_invisible = Viewport.new(0, 0, 1, 1)
@viewport_invisible.visible = false
end

#--------------------------------------------------------------------------
# ● ビューポートの解放
#--------------------------------------------------------------------------
alias a9_003_dispose_viewports dispose_viewports
def dispose_viewports
a9_003_dispose_viewports

@viewport_invisible.dispose
end
#--------------------------------------------------------------------------
# ● タイルマップの作成
#--------------------------------------------------------------------------
alias a9_003_create_tilemap create_tilemap
def create_tilemap
a9_003_create_tilemap
@tilemap.visible = false
@tile_sprite = TileSprite.new(544+448, 416+128, @tilemap, @viewport1)
end_3d
end

#--------------------------------------------------------------------------
def begin_3d
@tilemap.viewport = @viewport_invisible
@mode3d = true
@tile_sprite.show
end

#--------------------------------------------------------------------------
def end_3d
@tilemap.viewport = @viewport1
@mode3d = false
@tile_sprite.hide
end


#--------------------------------------------------------------------------
# ● タイルマップの解放
#--------------------------------------------------------------------------
alias a9_003_dispose_tilemap dispose_tilemap
def dispose_tilemap
a9_003_dispose_tilemap
@tile_sprite.dispose
end


#--------------------------------------------------------------------------
# ● タイルマップの更新
#--------------------------------------------------------------------------
alias a9_003update_tilemap update_tilemap
def update_tilemap
g = $game_map
unless g.mode3D == @mode3d
@mode3d ? end_3d: begin_3d
end
unless @mode3d
a9_003update_tilemap
else
@tile_sprite.update_map((g.display_x >> 8) - 7, (g.display_y >> 8) - 4)
end
end
end

#==============================================================================
# ■ Game_Vehicle
#------------------------------------------------------------------------------
#  乗り物を扱うクラスです。このクラスは Game_Map クラスの内部で使用されます。
# 現在のマップに乗り物がないときは、マップ座標 (-1,-1) に設定されます。
#==============================================================================

class Game_Vehicle < Game_Character

#--------------------------------------------------------------------------
# ● フレーム更新
#--------------------------------------------------------------------------
alias a9_003_update update
def update
a = @altitude
a9_003_update
update_angle(a)
end

def update_angle(alti)
def set_angle
$game_map.set_angle(90 - (45 / 8 * (@altitude / 4 + 1)))
end




end
end


NOTE FOR THE SCRIPTERS WHO WATCH THIS CODE: If you think i've done something wrong or i removed a critical proccess it shouldn't been removed, instead of complaining polite or impolitely, try to emprove it yourselves. And you should know this is a fix i improvised in 5 minutes, it makes the conic prespective always on and disables the airships changes on the angle and the critical variable. It works without bugs at least on my PC.

But the script has another problem apart from that. The objects (events) aren't fully synchronised with the map so sometimes when you walk, the events end being in the space (the background on the backside). This must be fixed but i can't request to the scripters (everytime i search it in 2chan i end in pages with erotic content), and i can't make it on my own (my scripting skills are great for windows but i don't know much about spriteset) so i let it on the air, if someone read this, maybe that one can fix it.


__________________________
------------- COMING SOON -------------

-Decryptor-holics Terror
Go to the top of the page
 
+Quote Post
   
PhantomH
post Jan 8 2009, 01:48 PM
Post #19


Ushiromiya Battler
Group Icon

Group: Revolutionary
Posts: 758
Type: Writer
RM Skill: Skilled




Someone should also fix the autotile problem as well for those who're using it in towns and/or cities. I was testing this script on one of my maps and then when the game is in Mode7, the roof for a house would either disappear or cover the walls until I go back to plain view. It would also be nice to somehow modify this script so it can use KGC's Tileset tool but we should worry about the first two issues first.


__________________________
Go to the top of the page
 
+Quote Post
   
Ziosin
post Jan 8 2009, 01:52 PM
Post #20


Doesn't ever stop believin'
Group Icon

Group: Revolutionary
Posts: 758
Type: Writer
RM Skill: Skilled




This script is freaking cool! I used it in the demo and feel in love with it tongue.gif.

Thanks for bringing it over here!


__________________________
Ziosin's signature, V3.0



Colossus Reborn

Project has been abandoned. I'm gonna keep around the kickass logo, though.
Go to the top of the page
 
+Quote Post
   

3 Pages V   1 2 3 >
Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 

Lo-Fi Version Time is now: 21st May 2013 - 10:48 AM
RPG RPG Revolution is an Privacy Policy and Legal
eXTReMe Tracker