ID:261227
 
I have the following code, and it gives me an error I have never seen before:

var/const/Player_Browse = {"
Welcome to Lord of Water's Texy game engine version [world.version]!

Please take note of the following things:

- At this point, this program is not finished to the point where you can actually play it. These test sessions are held so that I can work out bugs.

- The say verb only communicates with the game's GM ([GM]), while the chat verb communicates with everyone.

- Overuse of chat or request verbs (namely, spamming the setver in any way) may result in a boot. The GM has a boot verb, as well as a mute verb that will keep you quiet. Please be respectful!

Thanks for testing, and have a good time!
"}

And, the error:

Systems.dm:41:error:= :constant initializer required

The lime line is line 41.

Thanks!
Lord of Water wrote:
I have the following code, and it gives me an error I have never seen before:

<font color='lime'>var/const/Player_Browse = {"</font>
Welcome to Lord of Water's Texy game engine version [world.version]!

Please take note of the following things:

- At this point, this program is not finished to the point where you can actually play it. These test sessions are held so that I can work out bugs.

- The say verb only communicates with the game's GM ([GM]), while the chat verb communicates with everyone.

- Overuse of chat or request verbs (namely, spamming the setver in any way) may result in a boot. The GM has a boot verb, as well as a mute verb that will keep you quiet. Please be respectful!

Thanks for testing, and have a good time!
"}

And, the error:

Systems.dm:41:error:= :constant initializer required

The <font color='lime'>lime</font> line is line 41.

Thanks!



You made that way too hard the easy way to do it is:


mob/verb/help()
usr<<browse("WELCOME TO THIS GAME [usr] ENJOY YOUR STAY!!")


Now isn't that so much easier then using a var and all that?
In response to Nadrew
No, it is not. I want to know why the compiler is giving me an error.
Lord of Water wrote:
I have the following code, and it gives me an error I have never seen before:

<font color='lime'>var/const/Player_Browse = {"</font>
Welcome to Lord of Water's Texy game engine version [world.version]!

Please take note of the following things:

- At this point, this program is not finished to the point where you can actually play it. These test sessions are held so that I can work out bugs.

- The say verb only communicates with the game's GM ([GM]), while the chat verb communicates with everyone.

- Overuse of chat or request verbs (namely, spamming the setver in any way) may result in a boot. The GM has a boot verb, as well as a mute verb that will keep you quiet. Please be respectful!

Thanks for testing, and have a good time!
"}

And, the error:

Systems.dm:41:error:= :constant initializer required

The <font color='lime'>lime</font> line is line 41.

Thanks!

the error is that you are useing the const var.

form f1 help:

The const type modifier defines a constant value. This may be useful for centralizing the location of a value that is used repeatedly so that it can be easily configured. It has the advantage over #define macros of obeying the normal scope rules for variables. This means, for example, that a const variable declared inside a proc will not conflict with other variables declared elsewhere.

Example:
mob
var/const/max_items = 100

Enter(O)
if(src.contents.len >= src.max_items)
return 0
return ..()

This example defines an upper limit on the number of items a mob may carry.