Need help starting a script

Started by The Niche, October 05, 2010, 04:17:08 pm

Previous topic - Next topic

Aqua

== is a comparison operator...
What you're doing is waaaaay wrong.

And hm... maybe I did fix the event removal location o-o

The Niche

Then how come it works all of a sudden? Or at least, the first line does.
Level me down, I'm trying to become the anti-blizz!
Quote from: winkio on June 15, 2011, 07:30:23 pm
Ah, excellent.  You liked my amusing sideshow, yes?  I'm just a simple fool, my wit entertains the wise, and my wisdom fools the fools.



I'm like the bible, widely hated and beautifully quotable.

Dropbox is this way, not any other way!

Aqua

.x isn't in the class Map_Battler.

id, x, and y are attributes of the event class.

I think you set up the map for events wrong.

Blizzard

x and y are attributes of the Game_Character class which both classes share as superclass. The problem is that for some reason the ID does not match anymore and it's accessing probably a non-existent event (hence it being nil).
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

The Niche

So I've used the wrong event id?
Level me down, I'm trying to become the anti-blizz!
Quote from: winkio on June 15, 2011, 07:30:23 pm
Ah, excellent.  You liked my amusing sideshow, yes?  I'm just a simple fool, my wit entertains the wise, and my wisdom fools the fools.



I'm like the bible, widely hated and beautifully quotable.

Dropbox is this way, not any other way!

Blizzard

Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

The Niche

Alright, I have gotten the thingy workulating. However, it only works if I create one event. Any more and it explodes. Aqua, how do I set where the event will spawn? At present it spawns on the player's location, which is fine for a moving event, but not a stationery one.
Level me down, I'm trying to become the anti-blizz!
Quote from: winkio on June 15, 2011, 07:30:23 pm
Ah, excellent.  You liked my amusing sideshow, yes?  I'm just a simple fool, my wit entertains the wise, and my wisdom fools the fools.



I'm like the bible, widely hated and beautifully quotable.

Dropbox is this way, not any other way!

Aqua

Lemme see what edits you made first.

The Niche

Quoteclass AquaEventSkills
 
MAPID = 'Data/Map002.rxdata'
 
def self.eventid(id)
  case id
  #when [skill ID] then return [event id]
 
  when 1 then return 5

 
  end
  return 0
end
end

class Map_Battler
alias skill_effect_aqua_event_skills skill_effect
  def skill_effect(character, _battler, skill)
    if skill_effect_aqua_event_skills(character, _battler, skill)
      @eventskill = AquaEventSkills.eventid(skill.id)
      if @eventskill != 0
        map = load_data(AquaEventSkills::MAPID)
        max = ($game_map.events.keys + $game_map.map.events.keys).max
        max = 0 if max == nil
        max += 1
        event = map.events[@eventskill]
        event.id = max
        event.x = (@real_x + 64) / 128
        event.y = (@real_y + 64) / 128
        $game_map.map.events[max] = event
        $game_map.events[max] = Game_Event.new($game_map.map_id, event)
        sprite = Sprite_Character.new($scene.spriteset.viewport1, $game_map.events[max])
        $scene.spriteset.character_sprites.push(sprite)
        $game_map.events[max].spawned = true
      end
    end
    return
  end
end

class Game_Character
     attr_accessor :spawned
end
   
class BlizzABS::Processor
  alias event_removal_aqua_x event_removal
  def event_removal
    # Delete all spawned events that should be terminated
     ($game_map.events.values.find_all {|event|
         event.spawned && event.terminate}).each {|event|
         $game_map.events.delete(event.id)} 
  event_removal_aqua_x
  end
end
Level me down, I'm trying to become the anti-blizz!
Quote from: winkio on June 15, 2011, 07:30:23 pm
Ah, excellent.  You liked my amusing sideshow, yes?  I'm just a simple fool, my wit entertains the wise, and my wisdom fools the fools.



I'm like the bible, widely hated and beautifully quotable.

Dropbox is this way, not any other way!

Aqua

So when you use skill ID 1, it'll spawn event ID 5 found in map ID 2

o-o
Did you change the actual code at all?
I thought you said you made edits...

Lol and looking at the code again, it's not really the best coding.
@eventskill can just be eventskill

Anyway, where the event is spawned are these two lines.

event.x = (@real_x + 64) / 128
event.y = (@real_y + 64) / 128

Have fun editing

The Niche

Level me down, I'm trying to become the anti-blizz!
Quote from: winkio on June 15, 2011, 07:30:23 pm
Ah, excellent.  You liked my amusing sideshow, yes?  I'm just a simple fool, my wit entertains the wise, and my wisdom fools the fools.



I'm like the bible, widely hated and beautifully quotable.

Dropbox is this way, not any other way!