SRB2 Message Board  

Go Back   SRB2 Message Board > Sonic Robo Blast 2 > Editing > Editing Help

Reply
 
Thread Tools Search this Thread
Old 08-06-2020   #1
Shapeshifter Boi
Call me Neon
 
Shapeshifter Boi's Avatar
Default Why don't any of my skin checks work

Welp lets be upfront about it, this is the only line in the code to check for skin, and it says I'm doing arithmetic operations on it.


Code:
if (p.powers[pw_super] & p.mo.skin == "metalsonic") then
This is lua as well, I tried skin checking in many scripts beforehand, and they always don't work.
__________________
What if chaos mode existed.


"Hey lets play Generations!"
The console red rings mid-game.

Last edited by Shapeshifter Boi; 08-06-2020 at 01:00 PM.
Shapeshifter Boi is offline   Reply With Quote
Old 08-06-2020   #2
NAR the Fox
Self-taught Lua Amateur
 
NAR the Fox's Avatar
Default

I'm just a Lua amateur, but you need to rewrite the code like this, because that is an arithmetic operation:
Code:
if player.powers[pw_super] and player.mo.skin == "metalsonic" then
__________________
You can just call me "NARbluebear"
My YouTube Channel
NAR the Fox is offline   Reply With Quote
Old 08-06-2020   #3
Shapeshifter Boi
Call me Neon
 
Shapeshifter Boi's Avatar
Default

Quote:
Originally Posted by NAR the Fox View Post
I'm just a Lua amateur, but you need to rewrite the code like this, because that is an arithmetic operation:
Code:
if player.powers[pw_super] and player.mo.skin == "metalsonic" then

Hmmm, ill try it, doesn't seem too much different but i'll give it a go ahead

---------- Post added at 09:02 AM ---------- Previous post was at 09:01 AM ----------

Oh wait, the and is in there, I guess the symbol is for bitwise operations only.

---------- Post added at 09:03 AM ---------- Previous post was at 09:02 AM ----------

Thanks man, gonna try to put you as a contributor

---------- Post added at 09:05 AM ---------- Previous post was at 09:03 AM ----------

Also p was the player var, it's customizable to each function
__________________
What if chaos mode existed.


"Hey lets play Generations!"
The console red rings mid-game.
Shapeshifter Boi is offline   Reply With Quote
Old 08-06-2020   #4
NAR the Fox
Self-taught Lua Amateur
 
NAR the Fox's Avatar
Default

You are correct, "&" is the Bitwise AND operation. For future reference, you can check the BLua Syntax on the wiki.
__________________
You can just call me "NARbluebear"
My YouTube Channel
NAR the Fox is offline   Reply With Quote
Old 08-06-2020   #5
CobaltBW
Community Noise Maker
Developer
 
CobaltBW's Avatar
Default

Yeah, singular & is bitwise. In most other scripting languages, && is the equivalent of and, however blua doesn't appear to support this.
__________________
~CobaltBW

Check out my soundcloud profile for music stuff
CobaltBW is offline   Reply With Quote
Old 08-06-2020   #6
Shapeshifter Boi
Call me Neon
 
Shapeshifter Boi's Avatar
Default

Well the submission is up, ill do a test game with metal force skin and super run.


Also the only person joining is my brother because my network stuff is hot garbage and only hosts srb2 servers on lan
__________________
What if chaos mode existed.


"Hey lets play Generations!"
The console red rings mid-game.
Shapeshifter Boi is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 06:51 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2020, vBulletin Solutions, Inc.