User Tag List

Results 1 to 4 of 4

Thread: Armos->Next

  1. #1
    Username Kaiser SUCCESSOR's Avatar
    Join Date
    Jul 2000
    Location
    Winning.
    Age
    37
    Posts
    4,436
    Mentioned
    152 Post(s)
    Tagged
    7 Thread(s)
    vBActivity - Stats
    Points
    10,560
    Level
    30
    vBActivity - Bars
    Lv. Percent
    51.7%

    Armos->Next

    Now that the kinks are worked out...(I think). This is a script request by BigJoe. It is an Armos FFC. It can spawn any enemy you want. I can be solid. If you leave the layer combo at 0 the FFC Combo swaps with the one under the FFC. Any other layer invisible combos will be used to avoid scrolling issues. For solidity and spawning sake the FFC will snap to the combo grid. Make sure the top right corner is in the combo you want it placed on.

    This script also doubles as a Touch->Next (also BigJoe's idea) If you leave enemy(D0) argument at 0 the delay counter will determine how long Link must touch the combo before it changes. This only works with solid(D3) set to true or else the change will be instant.

    The FFC can leave an item as with normal Armos. This will store a bit (D7) to a Screen->D slot (D6) so the item only drops once. As the namee suggests when the script is done the FFC switches to the combo to the immediate right of the FFC Combo.

    Code:
    //invisible combos used when setting to layers.
    const int CMB_SOLID = 9; //an invisible solid combo.
    const int CMB_INVIS = 8; //a non-solid invisible combo.
    
    ffc script ArmosNext
    {
    	void run(int enemy, int sfx, int delay, bool solid, int layer, int itemDrop, int d, int bit)
    	{
    		this->X = (this->X>>4)<<4; this->Y = (this->Y>>4)<<4; //align to combo grid
    		int posX = this->X;
    		item it;
    		int wait = delay;
    
    		if(solid){
    			if(!layer)
    				SetLayerComboD(layer, ComboAt(this->X, this->Y), this->Data);
    			else
    				SetLayerComboD(layer, ComboAt(this->X, this->Y), CMB_SOLID);
    		}
    		
    		while(!LinkCollision(this)) Waitframe();
    		
    		if(!enemy){
    			
    			if(solid){
    				while(delay){
    					if(LinkCollision(this)){
    						delay--;
    						this->X = posX + Rand(2);	
    						Game->PlaySound(sfx);	
    						Waitframe();
    					}
    				else delay = wait;
    				this->X = posX;
    				Waitframe();
    				}
    			}
    		}
    		else{
    			for(;delay>0;delay--){
    				this->X = posX + Rand(3)-1;	
    				Game->PlaySound(sfx);	
    				Waitframe();	
    			}
    			this->X = posX;
    			CreateNPCAt(enemy, this->X, this->Y);
    		}			
    		if(solid) {
    			if(!layer)
    				SetLayerComboD(layer, ComboAt(this->X, this->Y), this->Data+1);
    			else
    				SetLayerComboD(layer, ComboAt(this->X, this->Y), CMB_INVIS);
    		}
    		this->Data++;
    		
    		if(itemDrop && !(Screen->D[d]&bit)){
    			it = CreateItemAt(itemDrop, this->X, this->Y);
    			Game->PlaySound(SFX_SECRET);
    		}
    		while(itemDrop && it->isValid() && !(Screen->D[d]&bit)) Waitframe();
    		Screen->D[d] |= bit;
    	} //end run()	
    } //end script
    
    //D0 the enemy number to spawn (if 0 no enemy spawns)
    //D1 Sound to play while "Armos" shakes 
    //D2 how long to shake the FFC before spawning the enemy
    //D3 whether or not the armos is solid (0 is false; 1 is true; FFC Combo must be solid)
    //D4 what layer the FFC combo is placed on. (Solidity only works on layer 0, 1, and 2)
    //D5 item to drop
    //D6 Screen Data slot to store to
    //D7 Bit to store
    Please post if you find an issue.

  2. #2
    I shall exalt myself over all Armagedddon Games bigjoe's Avatar
    Join Date
    Apr 2000
    Age
    39
    Posts
    5,618
    Mentioned
    87 Post(s)
    Tagged
    6 Thread(s)
    vBActivity - Stats
    Points
    6,570
    Level
    24
    vBActivity - Bars
    Lv. Percent
    93.02%
    To anyone who wants to use this script here is a tip: Make copies of the enemies you want to spawn and set their spawn type to instant. This will make the spawning look better.

  3. #3
    I shall exalt myself over all Armagedddon Games bigjoe's Avatar
    Join Date
    Apr 2000
    Age
    39
    Posts
    5,618
    Mentioned
    87 Post(s)
    Tagged
    6 Thread(s)
    vBActivity - Stats
    Points
    6,570
    Level
    24
    vBActivity - Bars
    Lv. Percent
    93.02%
    A bug with the hitboxes causes the item saving portion of this script to sometimes not work. In order to fix it, you should change !LinkCollision(it) to it->isValid().

    That should be easy enough, but for those who can't be bothered, here is the corrected script:

    Code:
    //invisible combos used when setting to layers.
    const int CMB_SOLID = 9; //an invisible solid combo.
    const int CMB_INVIS = 8; //a non-solid invisible combo.
    
    ffc script ArmosNext
    {
    	void run(int enemy, int sfx, int delay, bool solid, int layer, int itemDrop, int d, int bit)
    	{
    		this->X = (this->X>>4)<<4; this->Y = (this->Y>>4)<<4; //align to combo grid
    		int posX = this->X;
    		item it;
    		int wait = delay;
    
    		if(solid){
    			if(!layer)
    				SetLayerComboD(layer, ComboAt(this->X, this->Y), this->Data);
    			else
    				SetLayerComboD(layer, ComboAt(this->X, this->Y), CMB_SOLID);
    		}
    		
    		while(!LinkCollision(this)) Waitframe();
    		
    		if(!enemy){
    			
    			if(solid){
    				while(delay){
    					if(LinkCollision(this)){
    						delay--;
    						this->X = posX + Rand(2);	
    						Game->PlaySound(sfx);	
    						Waitframe();
    					}
    				else delay = wait;
    				this->X = posX;
    				Waitframe();
    				}
    			}
    		}
    		else{
    			for(;delay>0;delay--){
    				this->X = posX + Rand(3)-1;	
    				Game->PlaySound(sfx);	
    				Waitframe();	
    			}
    			this->X = posX;
    			CreateNPCAt(enemy, this->X, this->Y);
    		}			
    		if(solid) {
    			if(!layer)
    				SetLayerComboD(layer, ComboAt(this->X, this->Y), this->Data+1);
    			else
    				SetLayerComboD(layer, ComboAt(this->X, this->Y), CMB_INVIS);
    		}
    		this->Data++;
    		
    		if(itemDrop && !(Screen->D[d]&bit)){
    			it = CreateItemAt(itemDrop, this->X, this->Y);
    			Game->PlaySound(SFX_SECRET);
    		}
    		while(itemDrop && it->isValid() && !(Screen->D[d]&bit)) Waitframe();
    		Screen->D[d] |= bit;
    	} //end run()	
    } //end script
    
    //D0 the enemy number to spawn (if 0 no enemy spawns)
    //D1 Sound to play while "Armos" shakes 
    //D2 how long to shake the FFC before spawning the enemy
    //D3 whether or not the armos is solid (0 is false; 1 is true; FFC Combo must be solid)
    //D4 what layer the FFC combo is placed on. (Solidity only works on layer 0, 1, and 2)
    //D5 item to drop
    //D6 Screen Data slot to store to
    //D7 Bit to store

  4. #4
    Username Kaiser SUCCESSOR's Avatar
    Join Date
    Jul 2000
    Location
    Winning.
    Age
    37
    Posts
    4,436
    Mentioned
    152 Post(s)
    Tagged
    7 Thread(s)
    vBActivity - Stats
    Points
    10,560
    Level
    30
    vBActivity - Bars
    Lv. Percent
    51.7%
    I'll modify the original post to include BigJoe's fix. I am still trying to think of the best way to do it. If anyone has any ideas check out my thread in Scripting Discussion.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
About us
Armageddon Games is a game development group founded in 1997. We are extremely passionate about our work and our inspirations are mostly drawn from games of the 8-bit and 16-bit era.
Social