Guest Access
Administrator
Administrator
Administrator
profile
G@MeF@Ce
profile
here's my attempt towards a simple shooter script
(which is not so simple to do)
this is to go with GPLAT and make it a simple but fun ABS.
I started with the way XAS teleports events from one map to another, I understand and got that part down but then it gets real tricky.
shooting direction and hitting other events and turning switches.
GSHOT v0.1 (wip)
I'm stuck at making the shot go the same direction the player is facing.
and flipping a switch of the target event.
(which is not so simple to do)
this is to go with GPLAT and make it a simple but fun ABS.
I started with the way XAS teleports events from one map to another, I understand and got that part down but then it gets real tricky.
shooting direction and hitting other events and turning switches.
GSHOT v0.1 (wip)
- Code:
#===============================================================================
# G-SHOT (wip) by G@MeF@Ce 8/3/2011
#===============================================================================
module GSHOT
SHOT_KEY = Input::X #input
#SHOT_SFX = "" #audio
#SHOT_GFX = "" #character
SHOT_MAP_ID = 1 #the map the event is on
SHOT_EVENT_ID = 1 #the event id
#SHOT_SWITCH = 0 #the switch of target event the shot will enable
#SHOT_SPEED = 0 #the speed of the shot
#SHOT_TIME = 0 #the time of the shot before it is deleted
end
#===============================================================================
# Scene Map
#===============================================================================
class Scene_Map
attr_accessor :spriteset
end
#===============================================================================
# Game Map
#===============================================================================
class Game_Map
attr_reader :events
end
#===============================================================================
# Game SelfSwitches
#===============================================================================
class Game_SelfSwitches
def delete(key)
@data.delete(key)
end
end
#===============================================================================
# Interpreter
#===============================================================================
class Interpreter
include GSHOT
alias gshot update
#-------------------------------------------------------------------------
# update
#-------------------------------------------------------------------------
def update
gshot
unless $game_system.map_interpreter.running? or
@move_route_forcing or $game_temp.message_window_showing
if Input.trigger?(SHOT_KEY)
transfer_event(SHOT_MAP_ID,SHOT_EVENT_ID)
return
end
$game_player.refresh
end
end
#-------------------------------------------------------------------------
# transfer_event
#-------------------------------------------------------------------------
def transfer_event(mapid, eventid)
map = load_data(sprintf("Data/Map%03d.rxdata", mapid))
map.events[eventid].x = $game_player.x
map.events[eventid].y = $game_player.y
neweventid = $game_map.events.length+1
map.events[eventid].id = neweventid
$game_map.events[neweventid] = Game_Event.new($game_map.map_id, map.events[eventid])
$scene.spriteset = Spriteset_Map.new
end
end
I'm stuck at making the shot go the same direction the player is facing.
and flipping a switch of the target event.
Administrator
Show Signature
EVENTALIST
EVENTALIST
EVENTALIST
profile
mr_wiggles
profile
That's why in XAS you use the "step forward" move command, the event that is moved to the map gets turned in the same direction as the player (player facing left event is facing left.) This way when it steps forward it goes in the direction the player is facing.
In outbreak i use a more complex moving system that edits the event's real x and y variables for movement.
switches are as simple as this, when the event moves and its location changes have it check the map for events on its location then just have the script turn on the self switch in that event or the one(s) it hit.
I redid all the hit detections in WAX so its much faster then the old detection in XAS 3.72
In outbreak i use a more complex moving system that edits the event's real x and y variables for movement.
switches are as simple as this, when the event moves and its location changes have it check the map for events on its location then just have the script turn on the self switch in that event or the one(s) it hit.
I redid all the hit detections in WAX so its much faster then the old detection in XAS 3.72
EVENTALIST
Show Signature
EVENTALIST
Administrator
Administrator
Administrator
profile
G@MeF@Ce
profile
I guess I'm missing or I need to remove something in this script...?
I have the event on the map setup for step forward, but when that event is transferred from that map to the current, it goes in the direction the graphic was chosen. *shrugs*
I will continue to study
to make a script that when you press a button
transfers an event from another map in front on the player and goes the same direction the player is facing, erases when it hits a tile that is impassable or another event and turns that events page ~ is like a quest there's alot of things I must gather, before I can slay this dragon of a script. Thanks wiggles I will continue to study
WAX is b@D@$$ name for your engine +++
~ redid the hit detection? U R b@d@$$
I have the event on the map setup for step forward, but when that event is transferred from that map to the current, it goes in the direction the graphic was chosen. *shrugs*
I will continue to study
to make a script that when you press a button
transfers an event from another map in front on the player and goes the same direction the player is facing, erases when it hits a tile that is impassable or another event and turns that events page ~ is like a quest there's alot of things I must gather, before I can slay this dragon of a script. Thanks wiggles I will continue to study
WAX is b@D@$$ name for your engine +++
~ redid the hit detection? U R b@d@$$
Administrator
Show Signature