Can't find the operators

Modders can post their questions on scripting and more.

Moderators: Slitherine Core, BA Moderators

Post Reply
enric
Brigadier-General - 8.8 cm Pak 43/41
Brigadier-General - 8.8 cm Pak 43/41
Posts: 1855
Joined: Sun May 15, 2011 8:47 am

Can't find the operators

Post by enric »

I missed the bitwise operators I remember the >> worked to shift bit right but not remember the bit And , xOR , xAND etc.
pipfromslitherine
Site Admin
Site Admin
Posts: 9863
Joined: Wed Mar 23, 2005 10:35 pm

Re: Can't find the operators

Post by pipfromslitherine »

There is a Not() command in the scripting, as well as & and | operators.

Cheers

Pip
follow me on Twitter here
enric
Brigadier-General - 8.8 cm Pak 43/41
Brigadier-General - 8.8 cm Pak 43/41
Posts: 1855
Joined: Sun May 15, 2011 8:47 am

Re: Can't find the operators

Post by enric »

But this gives an error

if ( (x & 1) == 1)
{
Log("and 1");
}
pipfromslitherine
Site Admin
Site Admin
Posts: 9863
Joined: Wed Mar 23, 2005 10:35 pm

Re: Can't find the operators

Post by pipfromslitherine »

I think they can only be used as operators e.g.

x = x & 1

should work (I THINK!)

Cheers

PIp
follow me on Twitter here
enric
Brigadier-General - 8.8 cm Pak 43/41
Brigadier-General - 8.8 cm Pak 43/41
Posts: 1855
Joined: Sun May 15, 2011 8:47 am

Re: Can't find the operators

Post by enric »

Yes then it works, need more code (special characteristics of the script system )

y = x & 1

if (y == 1)
{
do the job

}
Post Reply

Return to “Battle Academy 2: Modders Corner”