ZScript has proven to do absolute wonders. Currently, I am learning C# and that has helped me out so far as I have been about to create void functions, functions with parameters, virtual and a few custom actor properties. (Still trying to wrap my head around actor flags though; I assume they are like simple bools). I got data types down as well as arrays (does zscript do lists and dictionaries as well?). I started with converting my custom monsters from decorate to zscript as to clean up their codes so it they aren't a jumbled mess of frames and {} blocks. But I have attempted to convert weapons over and I keep getting an error "incompatible self pointer", which seems to be a common error people are getting for zscript weapons. What exactly is causing this and how do you do it right?
Below is my own sample code for a custom melee attack for the player.
class Knuckles : Fist Replaces Fist
{
States
{
Fire:
PUNG B 4;
PUNG C 4;
PUNG D 5 {invoker.A_PlayerPunch();} //I included the "invoker" because I read that it is
//need from another forum. However, the function will
//print but the player can't land a punch.
PUNG C 4;
PUNG B 5 A_ReFire;
Goto Ready;
}
ZScript has proven to do absolute wonders. Currently, I am learning C# and that has helped me out so far as I have been about to create void functions, functions with parameters, virtual and a few custom actor properties. (Still trying to wrap my head around actor flags though; I assume they are like simple bools). I got data types down as well as arrays (does zscript do lists and dictionaries as well?). I started with converting my custom monsters from decorate to zscript as to clean up their codes so it they aren't a jumbled mess of frames and {} blocks. But I have attempted to convert weapons over and I keep getting an error "incompatible self pointer", which seems to be a common error people are getting for zscript weapons. What exactly is causing this and how do you do it right?
Below is my own sample code for a custom melee attack for the player.
class Knuckles : Fist Replaces Fist
{
States
{
Fire:
PUNG B 4;
PUNG C 4;
PUNG D 5 {invoker.A_PlayerPunch();} //I included the "invoker" because I read that it is
//need from another forum. However, the function will
//print but the player can't land a punch.
PUNG C 4;
PUNG B 5 A_ReFire;
Goto Ready;
}
void A_PlayerPunch()
{
A_PrintBold("Test");
if(Owner && Owner is "MaleMarine")
{
if(countinv("PowerStrength"))
{
A_CustomPunch(2*random(1, 10), true, 0, "MeleePuff", 0, 0, 0, "none", "player/male/fist", "skeleton/swing");
}
else
{
A_CustomPunch(4*random(1, 10), false, 0, "MeleePuff", 0, 0, 0, "none", "player/male/fist", "skeleton/swing");
}
}
else
{
if(!countinv("PowerStrength"))
{
A_CustomPunch(random(1, 10), true, 0, "MeleePuff", 0, 0, 0, "none", "player/male/fist", "skeleton/swing");
}
else
{
A_CustomPunch(2*random(5, 15), false, 0, "MeleePuff", 0, 0, 0, "none", "player/male/fist", "skeleton/swing");
}
}
}
}
Share this post
Link to post