Jump to content
IGNORED

Is this idea even possible?


STGraves
 Share

Recommended Posts

I was thinking on creating a way to disable collision detection when a switch is activated and not only deactivate it but also changing the three-dimensional position of the character, in other words allowing it to pass behind the PF, but I honestly couldn't think of a functional way to do so, any ideas, or better yet, is it even possible?

Link to comment
Share on other sites

I updated that program so it might be less complicated.

This flips the bit:


   _Bit2_Flip_CTRLPF{2} = !_Bit2_Flip_CTRLPF{2}



This puts what you need in CTRLPF:

   temp5 = 1 : temp5{2} = _Bit2_Flip_CTRLPF{2} : CTRLPF = temp5



Remember that when you use the individual bits of a variable to do simple on/off jobs, you can no longer use the whole variable for other jobs. For example, if you use one of the bits of the variable a, you can't use something like a = 48 or a = a + 1 in your program somewhere else. If you do, the bit you are trying to use in the variable a will end up getting overwritten.
Link to comment
Share on other sites

I got it to compile without crashing, I'm not sure if it's because the collision detection but my character can't go underneath the PF, do you think it has to do with that?

Say you have something like this:

 


   dim _Bit2_Flip_CTRLPF = y


   _Bit2_Flip_CTRLPF{2} = !_Bit2_Flip_CTRLPF{2}


   temp5 = 1 : temp5{2} = _Bit2_Flip_CTRLPF{2} : CTRLPF = temp5


 

And you want to use bit 7 instead of bit 2. Just do this:


   dim _Bit7_Flip_CTRLPF = y


   _Bit7_Flip_CTRLPF{7} = !_Bit7_Flip_CTRLPF{7}


   temp5 = 1 : temp5{2} = _Bit7_Flip_CTRLPF{7} : CTRLPF = temp5


 

Do not change the "temp5{2}" part of the code. If you changed it, that would be why you are having a problem.

Link to comment
Share on other sites

I was thinking on creating a way to disable collision detection when a switch is activated and not only deactivate it but also changing the three-dimensional position of the character, in other words allowing it to pass behind the PF, but I honestly couldn't think of a functional way to do so, any ideas, or better yet, is it even possible?

 

It sounds like you're limiting yourself to a modified collision detection example. If you're writing your own engine then you can simply use a flag to determine whether you run collision event code.

 

if dontprocesscollision = 1 then goto nocollsions

Link to comment
Share on other sites

That's an awesome idea but I have no variables left free, and I can't clean them, but I have a idea which involves restructuring the game.

 

I'd see what you can do using individual bits instead of whole variables.

 

dim attributes = g

 

def isnekkid=attributes{0}

def victhere=attributes{1}

def victdead=attributes{2}

def gotmarla=attributes{3}

def doorhere=attributes{4}

def popohere=attributes{5}

def ghostgone=attributes{6}

def bulletsnow=attributes{7}

 

if isnekkid then goto flashing

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...