Thu Nov 09, 2017 3:59 pm
ZippeyKeys12 wrote:Blue Shadow wrote:ZippeyKeys12 wrote:How does one add strings together?
Check here. You might find the answer.
I tried that, maybe I'm doing something else wrong.
string s1 = "test";
string s2 = s1..
string.format("%s %s", "test2", "test3");
Thu Nov 09, 2017 7:58 pm
Fri Nov 10, 2017 3:11 am
Fri Nov 10, 2017 1:04 pm
Spoiler: Example Code
Mon Nov 13, 2017 6:27 am
Tue Nov 14, 2017 1:19 pm
Tue Nov 14, 2017 2:34 pm
Uberkreatur wrote:Zscript is still documented not enough.
1. What is the difference between MonsterMove() and TryWalk()?
2. MonsterMove() and TryWalk() works like A_Chase with CHF_DONTTURN flag. If monster changes angle, it continues to move in the original direction. How to set this direction?
bool TryWalk ()
{
if (!MonsterMove ())
{
return false;
}
movecount = random[TryWalk]() & 15; // Sets movecount to a random number less than 16
return true;
}
if (--movecount < 0 || !MonsterMove())
{
NewChaseDir();
}
Thu Nov 16, 2017 7:29 pm
TextureId textlight = TexMan.CheckForTexture ("ZLIGHTLM", TexMan.Type_Any);
int linenum = 0;
int LightLineTag = 666;
LineIdIterator lit = LineIdIterator.Create(LightLineTag);
while ((linenum = lit.Next()) >= 0)
{
level.lines[linenum].sidedef[1].SetTexture(1, textlight); // sidedef[1] = back
}
TextureId textlight = TexMan.CheckForTexture ("-", TexMan.Type_Any);
Mon Nov 20, 2017 6:02 am
Mon Nov 20, 2017 10:24 am
action void X_DetonateBolts()
{
// Eriguns's Irebolt weapon fires sticky bolts that can be remotely detonated with
// Altfire. When each bolt is fired, its "master" pointer is set to the player that
// fired it. This function handles finding all the child bolts and detonating 'em.
// Firstly, since we know that all children will be of class "IreboltShot", we can
// explicitly tell our iterator that we're only looking for actors of this class
// for a bit of a performance boost.
ThinkerIterator boltIterator = ThinkerIterator.Create("IreboltShot");
IreboltShot bolt;
// Do the iteration. boltIterator.Next() returns an Actor, so we want to cast it to
// IreboltShot in order to call a custom function on it.
while(bolt = IreboltShot(boltIterator.Next() ) ) {
// Here, I'm checking that the bolt's "master" is the player; since I'm calling
// the function from the weapon, "self" is the player. Most likely, you'll
// be adding this function to your custom imp class, so "self" will be the imp
// itself too, meaning this is probably the check you're looking for.
if(bolt.master == self) {
// Do your special logic here.
bolt.X_BoltDetonate();
}
}
}
Mon Nov 20, 2017 11:44 am
Mon Nov 20, 2017 11:59 am
Spoiler: