Help a noob in need!!
Displaying 1-20 of 28 total.
12 next
Please enter a numerical value for the importance of this sticky.
Enter 0 to unsticky.
eltimo

I've been part of verge for a while and so far i've bin impressed by what you can do. I was able to do the first part of Rysen's tutorial which is the exit bit with the box that comes up with verge rocks but when i came to the second bit, i tried it (i know the code is the same as the one on the tutorial beacuse i copied and pasted it) and i got an error message saying "system.vc:"player" is not a recognised keyword or identifier. I was wonderin if sumone could help me (pleasepleaseplease) Heres the code at da mo:
void MapInit()
{
player = EntitySpawn(5,5,"darin.chr"); // Spawn Darin's Entity on the map at cords 5, 5.
SetPlayer(player); // Set it so we can control this entity with our keyboard
}

Please help!!

Posted on 2005-12-04 13:09:27

Kildorf

No worries, eltimo... this should be a pretty easy fix :)

Your problem here is that your "player" variable hasn't been declared. The VergeC compiler hasn't been told what you're talking about, so it gets confused.

To declare a variable, then, you just need to let Verge know what you want to call it, and what you'll be storing in it. In this case, you want the variable to be called "player", and you want it to store a number.

So you tell the compiler this:

   int player;


Now, you can put this inside of MapInit... but once you've left MapInit, your player variable will disappear! Just in case you want to access the player entity somewhere else, you'll want to make it "global". This means that all through your program, you'll be able to access your player variable.

To make it global, just put that declaring statement up above outside of any of your functions. A good place to declare global variables is at the beginning of the file.


Hope this helps! If I was confusing, just ask for clarification and I'll try to provide it.

Posted on 2005-12-04 13:18:08

Omni

EDIT: What Kildorf said... :)

Posted on 2005-12-04 13:21:31 (last edited on 2005-12-04 13:22:19)

eltimo

Thnx dude! i hope that works

Posted on 2005-12-04 14:01:30

eltimo

Allright i tried that and now i got another error -messageexpecting a function declaration - do you have a missing brace? (SetAppName)

void MapInit()
{
int player; player =EntitySpawn(5,5,"darin.chr"); // Spawn Darin's Entity on the map at cords 5, 5.
SetPlayer(player); // Set it so we can control this entity with our keyboard
}

Be really good if i could have some more help please

thanks :D

Posted on 2005-12-04 14:08:14

Interference22

Ok, this new error of yours is not attributed to the particular piece of code you've posted here.

Use what VERE's debugger has told you as a starting point: it's not just horrible jargon, it's trying it's best to give you some pointers. Firstly, find the line where you use the function SetAppName(). There's probably an error around this line that's causing VERGE some grief.

More than likely it's (surprise) a missing brace (one of those "{" things) or perhaps you didn't end a line with a ";" when you should have, or put one too may brackets in somewhere. Have a look around your code.

If you can't find it, post the block of code you use the SetAppName() function in and someone will probably be able to spot it.

Posted on 2005-12-04 16:34:56

rosh.r03

hi i'm eltimos frnd n i'm a bit confused about what exactley the integers and variables but i know what you'll say it's all explained in the tutz but that's all a bit ... hazy i'm new to programming and i've done a bit of html but this stuff's sh** hard to learn and work out. really confusled plz help!!!

Posted on 2005-12-05 10:19:09

Omni

A variable is a programming convention used to store a value at a location in data. An integer is any whole number.

You're right, we don't explain the fundamentals of programming in the tutorial, so reading our tutorial won't help you there.

But no one is going to be able to teach you how to program from scratch with these forum posts. Or, it is possible, but it could be a tedious experience.

I don't really know how to introduce someone to the concept of a "variable" and an "integer". I mean...one stores data, and the other is a specific type of number data. I recall it was difficult for me at first, but eventually at some point it just "clicked."

Have you ever tried programming in BASIC, or borrowed your grandfather's old Atari? I know, fat chance, but that's one way. Those languages are very simple and good for introducing you to how languages work in general.

There are many resources on the web, I'm sure, for young and budding programmers. And you don't have to be a professional here: all you want to know is how a variable works and what an integer is. That should be easy to find out; not much comes to mind at the moment, but www.wikipedia.org may have something.

Maybe a new article on the basics of programming; like walking you by the idea of using a variable...that might be useful. I'm not sure if anyone's already done it though, to be honest.

Posted on 2005-12-05 16:05:06

Interference22

I agree with Omni. Teaching programming languages is just shy of being as hard to do as teaching a foreign language: a bit beyond what most of us will commit to.

What will be helpful, however, is the fact that the particular language that VERGE uses is a derivative of one that is widely used: C. Yes, just the one letter. I know, programmers can't name programming languages for crap.

It helps if you learn a little about C and how that works before giving VERGE your full attention. There are LOADS more sites on the net that can teach the basics of C than there are on VERGE so it shouldn't be too hard finding some tutorials for introducing you into the general concepts of programming. Try googling for "c programming tutorials".

Posted on 2005-12-05 18:31:00

Omni

What could be especially effective is if you work along with the Verge tutorials as you study C syntax -- assuming you were to try to do so.

For example, Zip has an excellent "Hello World!" collection of programming tutorials for Verge -- it would be effective to support your VC work as you study basic programming.

Posted on 2005-12-05 21:18:47

rosh.r03

Hi. i've had a awsome idea. cud we encrporate j2me programming into the verge programming so as to be able to play the games on our mobiles? cus that wud be awsome

Posted on 2005-12-07 04:27:33

rosh.r03

Hi. i've had a awsome idea. cud we encrporate j2me programming into the verge programming so as to be able to play the games on our mobiles? cus that wud be awsome

Posted on 2005-12-07 04:31:13

Overkill

Nope, seeing as Verge is an engine in C++ and not Java. But if you know someone who wants to port it to mobiles, go ahead!

Posted on 2005-12-07 06:09:51

Omni

Java 2 mobile environment?

Posted on 2005-12-07 18:57:14

rosh.r03

fine scrape that but now as you know u've been on for a while and i wanted to get into the "feel" of verge but now i'm scraping that aswell and i've started my map but when i run it it comes up with:
tutorail.vc(1):expecting a function declarotion-do you have a missing brace?

this is my tutorial.vc
startup script: MapInit()
void AutoExec()
{
SetAppName("rosh is he best");
Map("tutorial.map");
}


cud you help my plz?

Posted on 2005-12-08 04:36:28

resident

Quote:
Originally posted by rosh.r03

fine scrape that but now as you know u've been on for a while and i wanted to get into the "feel" of verge but now i'm scraping that aswell and i've started my map but when i run it it comes up with:
tutorail.vc(1):expecting a function declarotion-do you have a missing brace?

this is my tutorial.vc
startup script: MapInit()
void AutoExec()
{
SetAppName("rosh is the best");
Map("tutorial.map");
}


cud you help my plz?



Okay. Lines which are comments to yourself need to begin in a ' // '

Example:
// This is my tutorial VC

Next, I'm not sure what that "startup script" line is doing. It may just be a comment or command that I'm not familar with, but I think that setting the first script to be executed needs to be done in maped, not added via the .VC file.

FYI, you shouldn't need anything in tutorial.VC It looks more like your system.VC file. Here are two sample, very basic .VC files that, Unless I've missed something, should let you wander around tutorial.map as Darin.

Finally, could you please do me a HUGE favour and put a wee bit more effort into your spelling? It's always worrying when someone asks for programming help and has spelling like that, because you can never tell if the errors they're getting might just be because of a mispelled line :)



// SYSTEM.VC

int plr, plrx, plry; // GLOBAL VARIABLES

void AutoExec()
{
SetAppName("rosh is the best");
Map("tutorial.map");
}

// TUTORIAL.VC
// Load up tutorial.map in Maped and use the map
// properties dialogue to choose mapinit as the
// starting function

void MapInit()
{
plr = EntitySpawn( 5, 5, "darin.chr");
}

Posted on 2005-12-08 05:17:52 (last edited on 2005-12-08 05:32:04)

resident

Variables aren't that hard a concept actually. They're just like a "box" in which you store a kind of data.

The type of box determines the kind of data it stores. An "integer" only stores whole numbers - 1, 2, 456446, and so on. A "floating point" variable allows for numbers with a fractional part. 1.23, or 2.45 or 3.14159265. A string contains letters.

The reason why we have both floats and ints, instead of just using the more accurate floats is because integer maths is traditionally a HELL of a lot faster than using floats.

Any questions? :)

Posted on 2005-12-08 05:50:43

rosh.r03

never mind guys because i got it up and running with a little help from my freinds eltimo & jigdafrod but my problem now is that when the game starts the game comes up but i have no characters there to move with please help actually leave it two days for me to look at the pdf and i'll come back.
thancks you guys rule!!!!!!
:)

Posted on 2005-12-08 07:52:03 (last edited on 2005-12-08 08:25:18)

resident

You need something like the entityspawn and setplayer commands in your map.vc file.

Obviously, entityspawn creates a new entity on the map, and setplayer give you control of it with the joystick.

Posted on 2005-12-08 14:07:55

Interference22

Some crucial advice, I think: download as many games from the V3 file archive as you possibly can. Most come with their source code and playing them (yes, play them! No sense in not having some fun while you're at it..) and then opening up and browsing through their VC script is one of the best ways of seeing first hand how each line of code has a direct effect on the game.

Try downloading some of our competition entries: they're the simplest to understand because they were all programmed under a strict time limit in most cases.

Posted on 2005-12-10 17:34:18


Displaying 1-20 of 28 total.
12 next
 
Newest messages

Ben McGraw's lovingly crafted this website from scratch for years.
It's a lot prettier this go around because of Jon Wofford.
Verge-rpg.com is a member of the lunarnet irc network, and would like to take this opportunity to remind you that regardless how babies taste, it is wrong to eat them.