Jump to content

Photo

Simple ZScript Series: the next script?


  • Please log in to reply
11 replies to this topic

#1 Kite

Kite

  • Members

Posted 15 February 2007 - 03:55 PM

Other people are handling some of the more complex things, such as brand spanking new items. As such, I'm wondering if there are any simple little things that people want made into scripts.

Examples of what I call simple would be the scripts in my signature. Those two scripts pretty much accessed a single feature available in scripting that was not available in the ZQuest interface. Are there any other such features that people would like to have a bit of access?

I'm pretty much opening the floor for requests, but please leave them to simple things. In other words, don't request items. I intend to do more complex scripts on request in the future, but I need more practice first.

So... request away and I might see what I can do. icon_wink.gif

#2 CastChaos

CastChaos

    Deified

  • Members

Posted 16 February 2007 - 03:39 PM

Well, I tried to make an escaping Cucco... An FFC which always gets away from Link, when Link gets in 2-3 distance.

Can YOU do it?

#3 Kite

Kite

  • Members

Posted 16 February 2007 - 03:53 PM

Movement systems are still a tad beyond me, as I haven't had the time to think through formulas and such. This is why I haven't gotten into custom enemies and such yet.

This type of script would require both a movement system and solidity checks that alter the movement system. The getting away from Link part would be easy enough (check to see if Link is within x pixels of the FFC)... it's just making it in a realistic manner that would be the problem for me. I might be able to do it, but I wouldn't count on a result immediately. icon_shrug.gif

#4 Limzo

Limzo

    _

  • Members

Posted 16 February 2007 - 05:15 PM

How about making Z3 animation link walk slower and have 11 frames of animation?

Ahaha. A challenge.

#5 Kite

Kite

  • Members

Posted 16 February 2007 - 07:01 PM

QUOTE(Limzo @ Feb 16 2007, 05:15 PM) View Post

How about making Z3 animation link walk slower and have 11 frames of animation?

Ahaha. A challenge.

This is probably possible so long as there is a Link action handler for everything. One of the things I've actually considered is a Link tile replacement system. icon_razz.gif

The problem I can see will be slowing things down reasonably. After all, we'd want to avoid having Link look like he is dragging his feet. Then again, we could leave it to the user to specify the number of frames and how fast they go. Another problem is... well... reacting to various flags. I don't think there is a way to detect screen flags at the moment, so making Link invisible would have to be handled by another portion of the script.

Everything else can be handled by the original Link model as an invisible entity.

I'll see what I can do about this. This was actually one of the things I was wanting to do, but I forgot about it. Thanks for reminding me. icon_smile.gif

#6 Revfan9

Revfan9

    Hero of Time

  • Banned
  • Real Name:Dr. Pajamas
  • Location:In front of a screen

Posted 16 February 2007 - 11:00 PM

Well, scripts don't currently allow us to change Link's actual graphic, although we can make Link invisible and put an FFC over him, but that would take a bit of work...

#7 Kite

Kite

  • Members

Posted 16 February 2007 - 11:21 PM

QUOTE(Revfan9 @ Feb 16 2007, 11:00 PM) View Post

Well, scripts don't currently allow us to change Link's actual graphic, although we can make Link invisible and put an FFC over him, but that would take a bit of work...

That's what I was planning. Unfortunately, it does mean sticking the new sprites in a specific order (unless they edit the script)... as there is no way to check which tiles Link is using. This shouldn't be too much of a problem, though. Granted I will have to take the three Link sizes into account... and people may not like things being specifically ordered... icon_shrug.gif

Most of this stuff is simple checking for Link's current state:
[codebox]//From std.zh
//Link actions
const int LA_NONE = 0;
const int LA_WALKING = 1;
const int LA_ATTACKING = 2;
const int LA_FROZEN = 3;
const int LA_HOLD1LAND = 4; // One hand.
const int LA_HOLD2LAND = 5; // Both hands.
const int LA_RAFTING = 6;
const int LA_GOTHURTLAND = 7;
const int LA_INWIND = 8;
const int LA_SCROLLING = 9;
const int LA_WINNING = 10;
const int LA_SWIMMING = 11;
const int LA_HOPPING = 12;
const int LA_GOTHURTWATER = 13;
const int LA_HOLD1WATER = 14;
const int LA_HOLD2WATER = 15;
const int LA_CASTING = 16;
const int LA_CLIMBCOVERTOP = 17;
const int LA_CLIMBCOVERBOTTOM = 18;
const int LA_DYING = 19;[/codebox]

In retrospect, dying, winning, and scrolling probably won't be fun (if they are even possible), though... icon_sweat.gif

#8 Saffith

Saffith

    IPv7 user

  • Members

Posted 17 February 2007 - 12:24 AM

I expect you could replace Link's sprite as easily as this:
CODE
while(true)
{
   this->Data = BASE_COMBO + Link->Action * 4 + Link->Dir;

   this->X = Link->X - X_OFFSET;
   this->Y = Link->Y - Y_OFFSET;

   Waitframe();
}

Then it'd just be a matter of arranging the combos properly.
I haven't tested that, though. There could be some problems with the animation. And, yeah, I'm not certain dying, winning, and scrolling are possible...

Also, there are the problems of flashing when hit and changing CSets according to rings. I don't think either of those would be impossible, though.

#9 Limzo

Limzo

    _

  • Members

Posted 17 February 2007 - 03:07 AM

QUOTE(Nick @ Feb 17 2007, 04:21 AM) View Post

That's what I was planning. Unfortunately, it does mean sticking the new sprites in a specific order (unless they edit the script)... as there is no way to check which tiles Link is using. This shouldn't be too much of a problem, though. Granted I will have to take the three Link sizes into account... and people may not like things being specifically ordered... icon_shrug.gif

Most of this stuff is simple checking for Link's current state:
[codebox]//From std.zh
//Link actions
const int LA_NONE = 0;
const int LA_WALKING = 1;
const int LA_ATTACKING = 2;
const int LA_FROZEN = 3;
const int LA_HOLD1LAND = 4; // One hand.
const int LA_HOLD2LAND = 5; // Both hands.
const int LA_RAFTING = 6;
const int LA_GOTHURTLAND = 7;
const int LA_INWIND = 8;
const int LA_SCROLLING = 9;
const int LA_WINNING = 10;
const int LA_SWIMMING = 11;
const int LA_HOPPING = 12;
const int LA_GOTHURTWATER = 13;
const int LA_HOLD1WATER = 14;
const int LA_HOLD2WATER = 15;
const int LA_CASTING = 16;
const int LA_CLIMBCOVERTOP = 17;
const int LA_CLIMBCOVERBOTTOM = 18;
const int LA_DYING = 19;[/codebox]

In retrospect, dying, winning, and scrolling probably won't be fun (if they are even possible), though... icon_sweat.gif

Wow. Hang on, does the const command mean that you can't change the variable set by int then?


#10 Snarwin

Snarwin

    Still Lazy After All These Years

  • Members
  • Real Name:Paul
  • Location:New York

Posted 17 February 2007 - 10:02 AM

QUOTE(Limzo @ Feb 17 2007, 03:07 AM) View Post

Wow. Hang on, does the const command mean that you can't change the variable set by int then?
Putting "const" in front of a variable definition makes that variable a constant--that is, it can't be changed--so LA_SWIMMING, for example, will always be equal to 11. They're meant to be used with Link->Action:

QUOTE(ZScript Documentation)
int Action
* Link's current action. Use the LA_ constants in std.zh to set or
* compare this value.


#11 Limzo

Limzo

    _

  • Members

Posted 17 February 2007 - 10:20 AM

Ahar, so I was right. Wow, I've only been learning C++ for 3 days and I'm picking new stuff up by guessing.

#12 Kite

Kite

  • Members

Posted 18 February 2007 - 08:02 PM

I don't really see a non-messy way around scrolling (the major issue), dying, or winning... so I'm probably not going to be making that script anytime soon.

One of the things I have tried to get away from with scripting is hack jobs. Granted this was perfectly fine with me when we were limited to using warps and multiple screens for custom bosses and such, that was because the ZC engine had no capability of doing otherwise.

Scripting is an entirely different beast... because scripts are meant to be reusable in a rather easy way, especially these scripts being done on request. Doing a hack job with this probably wouldn't help anyone in the long run and would present problems that would annoy people anyway. icon_shrug.gif

I might try the escaping cucco script later this week or next week. I imagine it will just fly away a short distance when Link comes within range, right? Is there going to be any way to catch it?


1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users