Jump to content

Photo

ghost.zh


  • Please log in to reply
645 replies to this topic

#481 Orithan

Orithan

    Studying Scientist - Commission from Silvixen

  • Members
  • Location:Australia

Posted 16 December 2015 - 03:02 PM

Sooo I am running into some issues with this script.

 

Script

 

Basically, my problems with this Ice Lynel script is that if the enemy is stunned, the script will not draw the enemy sprite or the ice layer (which occurs because they both use drawing commands and stunning stops GhostWaitframe from returning, preventing them from being drawn). Anyone know to alleviate this issue to allow for these Ice Lynels to be stunned?



#482 Saffith

Saffith

    IPv7 user

  • Members

Posted 16 December 2015 - 04:25 PM

If you're doing extra drawing yourself, you'll need to leave GHF_STUN unset and handle it yourself. Putting the body of IceLynelWaitframe() inside do { ... } while(ghost->Stun>0); should do it.

Side note: AttributeFlagCheck() could be a lot simpler (and faster):
bool AttributeFlagCheck(int attribute, int flag)
{
    return (attribute&(1<<flag))!=0;
}


#483 ywkls

ywkls

    Master

  • Members

Posted 17 December 2015 - 03:18 PM

Something that I'm having trouble with in ghost.zh- how eweapons react to combos. I've tried using some headers like stdCombos,zh and my own functions like Screen->isSolid() checks to make them interact properly. This is especially broken in sideview areas.

 

Additionally, I've had trouble getting the settings  for the eweapon movement function related to EWM_THROW set up correctly. It seems as if setting it to a high speed results in a more accurate shot that a low speed one. When you think about that in the terms of physics, objects with high speed should go farther than those with low speed; but the opposite seems to be the case.

 

Basically, I want to make eweapons that would move towards Link after touching the ground; as though they are bouncing. Some of the things that I've tried have broken the rest of my code and this is literally the last thing I need for it to do. Any help would be appreciated.



#484 Deedee

Deedee

    Small Pixie Dragon

  • Administrators
  • Real Name:Deedee
  • Pronouns:She / Her, They / Them
  • Location:Canada

Posted 17 December 2015 - 03:57 PM

if (weapon->Z == 0)
{
weapon->Jump = 2;
weapon->Angle = RadianAngle(weapon->X, weapon->Y, Link->X, Link->Y);
}


#485 Lejes

Lejes

    Seeker of Runes

  • Members
  • Location:Flying High Above Monsteropolis

Posted 17 December 2015 - 09:54 PM

I don't believe weapons other than rocks react to combos at all, unless they're block or trigger type combos.

As for EWM_THROW, it works that way because it's only an approximation. It won't ever be completely accurate, and it gets worse the farther away the target is as I recall. Jump and acceleration due to gravity are in units of pixels/frame and pixels/frame^2, respectively, so doing the math yourself isn't too hard. Here's a script I made a while ago that demonstrates it.

Arcing Link script


This is meant to move Link, who inherently obeys gravity. Only bombs, bait, and fire weapons naturally obey gravity, though, so you'll likely need to handle the weapon's Z axis acceleration yourself. I might make a version of this specifically for weapons later.

#486 ywkls

ywkls

    Master

  • Members

Posted 18 December 2015 - 10:08 AM

I thought of this idea a while ago and only recently worked out the logic to it. A suggestion for a possible addition to the available Ghost.zh movement functions. I haven't tested it to see how it works, but I can't think of any reasons why it wouldn't.

//Allows easy set up of circular movement for a ghosted enemy. 
//Example: angle = Ghost_MoveInCircle(angle,Link->X,Link->Y,32,3,45)
//		   Enemy circles Link at a distance of 32 pixels at a speed of 3, starting 45 degrees clockwise from zero. (Facing right)
//D0- Angle
//D1- Center of circle in X.
//D2- Center of circle in Y.
//D3- Radius of circle.
//D4- Speed of rotation. Use negative numbers for counterclockwise rotation.
//D5- Angle of offset from zero (facing right), if any.

float Ghost_MoveInCircle(float angle, int Circle_Center_X, int Circle_Center_Y,int radius, int speed, float angle_offset){
	Ghost_X = Circle_Center_X + radius * Cos(angle + angle_offset);
	Ghost_Y = Circle_Center_Y + radius * Sin(angle + angle_offset);
	angle = (angle+speed)% 360;
	return angle;
}

There are also methods which could be used for figure-8 movement, but I thought I'd get some feedback on this one first.


Edited by ywkls, 18 December 2015 - 10:10 AM.


#487 ywkls

ywkls

    Master

  • Members

Posted 22 December 2015 - 02:39 PM

@Saffith- You mention in your update to ghost.zh that the Ghosted weapons can have fake Z movement. I'm guessing that this is so that they behave properly in sideview gravity. Is this correct? And if so, how would you set them up so that they function correctly?



#488 Saffith

Saffith

    IPv7 user

  • Members

Posted 24 December 2015 - 01:28 AM

Fake Z is like the "Enemies Jump/Fly Through Z-Axis" rule. Weapons with fake Z will hit Link even if it looks like they're high in the air.

#489 ywkls

ywkls

    Master

  • Members

Posted 26 December 2015 - 06:33 PM

Is there a way that currently exists in ghost.zh to create eweapons that don't fall to the bottom of the screen in sideview gravity? Or has that not been done yet? And if it hasn't been done, I'd like to request that it be put on the list of future features to add to ghost.zh.

 

So far, every attempt that I've made to do this on my own has resulted either in breaking some other part of my script or the eweapons completely ignoring my commands.



#490 Lejes

Lejes

    Seeker of Runes

  • Members
  • Location:Flying High Above Monsteropolis

Posted 26 December 2015 - 07:35 PM

Most weapons ignore gravity innately. Only fire, bombs, and bait obey it. If you want one of those three to not fall, just set its Jump variable to 0 every frame.
  • ywkls likes this

#491 ywkls

ywkls

    Master

  • Members

Posted 26 December 2015 - 10:40 PM

@Lejes- Are you sure? Because they seem to react to it... in any case, it is good to know that weapons have a Jump attribute. I had looked over zscript.txt several times and failed to notice that. Now that I see that it exists, manipulating things will be much easier... I hope.



#492 Deedee

Deedee

    Small Pixie Dragon

  • Administrators
  • Real Name:Deedee
  • Pronouns:She / Her, They / Them
  • Location:Canada

Posted 11 February 2016 - 09:51 PM

Somehow, I went 2 whole months without commenting this bug. Anyways...

 

Ghost_ConstantWalk completely ignores the Rate argument. I don't think this is intentional.



#493 Saffith

Saffith

    IPv7 user

  • Members

Posted 19 February 2016 - 01:39 PM

Have you got the latest version? That should be fixed already in 2.8.

#494 Cukeman

Cukeman

    "Tra la la, look for Sahasrahla. ... ... ..."

  • Banned
  • Location:Hyrule/USA

Posted 01 March 2016 - 05:15 PM

I get  the "failure to parse imported file" error for both ghost.zh (2.3.1) and ffcscript.zh (1.1.1) in ZC 2.50.2 (Mac).

 

I know I've had import errors in the past, but I always thought it was just that the Mac version simply can't compile any scripts at all. Well, I recently discovered that it can compile other scripts, just not these two; so I wondered if that might be useful information, or reveal an easy fix if there's something worded strangley in ghost.zh or ffcscript.zh

 

That's probably not the case, but I thought I'd ask since it's a pain to reboot my Mac in Windows mode everytime I want to compile a script (ghost.zh and ffcscript.zh import fine when I do it in Windows XP).

 

I tried importing them together and separately.


Edited by Cukeman, 01 March 2016 - 05:16 PM.


#495 Saffith

Saffith

    IPv7 user

  • Members

Posted 01 March 2016 - 09:24 PM

Are you sure you have them in the right directory? They should be in Contents/Resources inside the ZQuest package.

It doesn't seem to extract the files the way I expect... If you have a ghost_zh folder with another ghost_zh folder and some other stuff inside, it's the stuff inside the folder that needs to go there.


1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users