Raised This Month: $252 Target: $400

Trying to compile snake

Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Senior Member
Join Date: Jun 2020
Old 07-25-2020 , 18:27   Trying to compile snake
Reply With Quote #1

So it doesn't compile in newer versions of SM. I decided to try and update the syntax to get it to compile. For some reason enum structs (when to use then and when not and how to handle them) are what always throw me for a loop.

So my first attempt (code here - https://pastebin.com/xijWumi8 )was to update everything to new syntax as normal and the only error I'm left with is to update the enum to enum struct.

snake.sp(91) : warning 213: tag mismatch (expected "WormMode", got "int")
snake.sp(92) : warning 213: tag mismatch (expected "WormMode", got "int")
snake.sp(293) : warning 213: tag mismatch (expected "WormMode", got "int")
snake.sp(298) : error 153: Array-based enum structs have been removed. See https://wiki.alliedmods.net/SourcePawn_Transitional_Syntax#Enum_Structs
snake.sp(299) : warning 213: tag mismatch (expected "int", got "WormMode")
snake.sp(300) : warning 213: tag mismatch (expected "int", got "WormMode")
snake.sp(301) : warning 213: tag mismatch (expected "WormMode", got "int")
snake.sp(316) : warning 213: tag mismatch (expected "WormMode", got "int")
snake.sp(380) : warning 213: tag mismatch (expected "WormMode", got "int")
snake.sp(381) : warning 213: tag mismatch (expected "WormMode", got "int")
The warnings are all related to the same.

However I don't understand the difference here. Both of these enums appear to have set values and don't mix data types.

enum WormDirection
	Direction_Right = 0,

enum WormMode
	Mode_Snake1, // walls are solid
	Mode_Snake2 // walls are walkable
But I'm getting an error telling me to turn WormMode into an enum struct, but not for WormDirection.

Changing it to an enum struct introduces a lot more errors and complications that I can't seem to fix.

Now I have this code - https://pastebin.com/kALEd6se

And I have a lot more errors I don't know how to fix:

snake2.sp(182) : error 017: undefined symbol "Mode_Snake1"
snake2.sp(194) : error 017: undefined symbol "Mode_Snake2"
snake2.sp(293) : error 033: array must be indexed (variable "g_iSnakeMode")
snake2.sp(298) : error 174: symbol 'WormMode' is a type and cannot be used as a value
snake2.sp(299) : error 017: undefined symbol "Mode_Snake1"
snake2.sp(300) : error 017: undefined symbol "Mode_Snake2"
snake2.sp(301) : error 033: array must be indexed (variable "g_iSnakeMode")
snake2.sp(310) : error 017: undefined symbol "Mode_Snake1"
snake2.sp(316) : error 033: array must be indexed (variable "g_iSnakeMode")
snake2.sp(565) : error 017: undefined symbol "Mode_Snake1"
snake2.sp(629) : error 017: undefined symbol "Mode_Snake1"
snake2.sp(693) : error 017: undefined symbol "Mode_Snake1"
snake2.sp(756) : error 017: undefined symbol "Mode_Snake1"

13 Errors.
enderandrew is offline

Thread Tools
Display Modes

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 -4. The time now is 02:39.

Powered by vBulletin®
Copyright ©2000 - 2020, vBulletin Solutions, Inc.
Theme made by Freecode