Jump to content


Photo

spawnpoint issue


  • Please log in to reply
23 replies to this topic

#21 Piwaket

Piwaket

    GMC Member

  • New Member
  • 49 posts
  • Version:GM8

Posted 07 May 2012 - 09:13 PM

or you could just use place_free place_empty or i dono place_meeting(might work... could use "all" as the object dono) before you spawn the objects... im not sure why you want 2 solids to spawn overlapping then either change the spawn point or jump the object to a near free spot using the same function


it would just solve alot of clipping and sticking solids issue i have if i could get it to work.

heres the real problem, i actually do use a collision check before spawn which stopps stuff from spawning in solids but..... (i didnt wanna have to explain this cause im gonna get called a dummy..... ) my mobiles are solid, .... i have my reasons ...and mostly it works but occasionally they get caught up in eachother or the main character, or other solids, and i thought that would be an easy solution rather than re-coding everything and trying to make non solid monsters that dont stack on eachother or the main character...or walk through stuff....or many other issues i was having with non-solid monsters.

edit: i did try with non-solid monsters at first(i understand thats the best way.) but no matter what i did i couldnt get them to not "stack" i tried it in collision events (if collision with another monster "bounce off" then check "all objects") ....i tried if place_meeting move toward at - speed....none of it worked the way i wanted.... so i turned them solid and it works mostly as i said....so that one lil code should fix the remaining issues in the rare event that they do get caught up in something.

Edit Edit: (i edit alot) honestly i think it would solve alot of peoples collision issues and be a priceless code for mobiles in any overhead game whether the mobiles were solid or not.... if ure stuck in a solid, jump out of it..... could it be any simpler? .....afterthought, it would probably have to be an "end step" event so right before draw it would override any previous move instructions with a "move toward" that direction, or a stop moving at all instruction as well so if the monster was trying to walk toward or into the solid it would stop trying, and once the collision was over it would resume normal movement.

Edited by Piwaket, 07 May 2012 - 09:46 PM.

  • 0

#22 Jack Indie Box

Jack Indie Box

    GMC Member

  • GMC Member
  • 1460 posts
  • Version:GM:Studio

Posted 07 May 2012 - 11:29 PM

you have massively over complicated this. next time say why you want something. as ive spent alot of time on this all im going to say is google "game maker move out of solid" if you cant find it(i didnt search myself) im sorry, but it does exist and i have used it.

your spawn/collision system doesnt sound great no offense
  • 0

#23 Piwaket

Piwaket

    GMC Member

  • New Member
  • 49 posts
  • Version:GM8

Posted 08 May 2012 - 12:12 AM

im an idiot and it was total operator error in the monster ai that once it "locked" on something it would stop randomizing direction entirely....

i got it all sorted out, but i would still like a simple step code for if an object's mask is touching a solid, it jumps one pixel the opposite direction each step, just to know how to do it properly.
....sry im pretty new to all this and i did alot of google-work and searching trying to figure it out. i thought it was a pretty straightforward request, you wanted all the specifics.

Edited by Piwaket, 08 May 2012 - 01:11 AM.

  • 0

#24 Jack Indie Box

Jack Indie Box

    GMC Member

  • GMC Member
  • 1460 posts
  • Version:GM:Studio

Posted 08 May 2012 - 08:46 AM

well generally designers try to prevent this situation not work with it. like in a collision putting x=xprevious; y=yprevious; or a better collision to prevent being stuck at all. or checking if a place is free ebfore you move to it...
  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users