Jump to content

Photo

Cannot Move gohma with scripts?


  • Please log in to reply
2 replies to this topic

#1 Jambu

Jambu

    Doyen(ne)

  • Members
  • Pronouns:He / Him

Posted 26 April 2024 - 09:19 PM

npc script sandcrabgohma
{
	void run()
	{
		int xstep = 150;
		int ystep = 67;
		int counter = 0;
		int movestate = Rand(4);
		while(true)
		{
			++counter;
			unless(counter < 60){
				if(Rand(16) < this->Rate)
					movestate ^= 2; //toggle horizontal and vertical movement.
					counter = 0;
			}
			switch (movestate)
			{
				case 0: //Up
					this->Y -= ystep/100.0;
					unless(this->Y > 32)
						movestate |= 1;
					break;

				case 1: //down
					this->Y += ystep/100.0;
					unless(this->Y < 128)
						movestate |= 1;
					break;
				
				case 2: //left
					this->X -= xstep/100.0;
					unless(this->X > 32)
						movestate |= 1;
					break;
				
				case 3: //right
				default:
					this->X += xstep/100.0;
					unless(this->X < 176)
						movestate |= 1;
					break;
			}
			Waitframe();
		}
	}
}

it's suppose to turn gohmas walk pattern into that of sand crabs but it seems Gohma's movement is hard coded?



#2 Russ

Russ

    Caelan, the Encouraging

  • Administrators
  • Location:Washington

Posted 26 April 2024 - 09:26 PM

Most Z1 bosses have incredibly hard-coded movement patterns. You may able to rig something up by forcing them to a particular X and Y position ever single frame, but even then, your results may vary, depending on the boss.


  • Jambu likes this

#3 Jambu

Jambu

    Doyen(ne)

  • Members
  • Pronouns:He / Him

Posted 27 April 2024 - 08:03 AM

Most Z1 bosses have incredibly hard-coded movement patterns. You may able to rig something up by forcing them to a particular X and Y position ever single frame, but even then, your results may vary, depending on the boss.

Noted... The engine will fight me if I try to script their movement.

 

I might be able to get away with just making a simple sandcrab from scratch (if I can't find one on the forums database) plus something like that is recyclable as its a common movement pattern. Then using that as a base for my gohma script? But how exactly would I make the legs invincible I wonder?




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users