Jump to content


Photo

Enemy outside view


  • Please log in to reply
2 replies to this topic

#1 WingedSkyNinja

WingedSkyNinja

    GMC Member

  • GMC Member
  • 46 posts
  • Version:GM8

Posted 25 December 2011 - 05:48 PM

I was wondering how to make enemy shoot only if he is inside the view, and not when he is outside the view. help ?
  • 0

#2 icuurd12b42

icuurd12b42

    Self Formed Sentient

  • Global Moderators
  • 14384 posts
  • Version:GM:Studio

Posted 25 December 2011 - 06:47 PM

GM8 and higher

on create,
inview=true;

on Outside View 0
inview = false;


on Boundary view 0
inview = true;



to shoot, check again the inview variable.

or, in end step
if(bbox_right>=view_xview)
    if(bbox_bottom>=view_yview)
        if(bbox_top<=view_yview+view_hview)
            if(bbox_left<=view_xview+view_wview)
            {
                //in view
            }

  • 0

#3 WingedSkyNinja

WingedSkyNinja

    GMC Member

  • GMC Member
  • 46 posts
  • Version:GM8

Posted 11 January 2012 - 01:05 PM

GM8 and higher

on create,
inview=true;

on Outside View 0
inview = false;


on Boundary view 0
inview = true;



to shoot, check again the inview variable.

or, in end step

if(bbox_right>=view_xview)
    if(bbox_bottom>=view_yview)
        if(bbox_top<=view_yview+view_hview)
            if(bbox_left<=view_xview+view_wview)
            {
                //in view
            }


Thanks a lot :biggrin:
  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users