help spawning entity
Displaying 1-14 of 14 total.
1
Please enter a numerical value for the importance of this sticky.
Enter 0 to unsticky.
djackson2009

what am i missing?


void autoexec()
{
int player=EntitySpawn(5, 5, "player.chr");
SetPlayer(player);
}

and where the hell can i find some tutorials?

Posted on 2011-05-04 02:18:26 (last edited on 2011-05-04 02:28:27)

mcgrue

Two questions:
1. Is this a map vc file, or your system.vc?
2. Is player.chr in the project directory?

Posted on 2011-05-04 03:00:46

djackson2009

its in the system.vc does it have to be in the map vc or can u do it without using a map? and ya its in the project directory

Posted on 2011-05-04 16:38:15

djackson2009

and is there a code to put in the system.vc when making a map.vc?

Posted on 2011-05-04 16:40:21

Keast

Ok, basicly, this is how Verge works:

1. Load System.vc and execute everything. Somewhere in there you have to put map("bla.map"); which calls the map and the corresponding bla.vc

2. The map's vc is executed. You have to put any spawns at the beginning of that file (or alternatively, spawn via maped).

I for myself am quite a noob, so don't kill me... uhm.

Posted on 2011-05-05 05:24:13

djackson2009

i did that but theres something missing or wrong with the code cuz it still dont work

Posted on 2011-05-05 16:46:14

Keast

Ok, it may be that the function in the map.vc (which btw should not be "void autoexec()", but rather something like "start()") is not being called. As far as I know, you have to define the function Verge calls on mapload in the Maped settings.

Posted on 2011-05-07 09:48:19

Rysen

This is a really old tutorial I wrote many moons ago, which was never completed but I think is still a good starting point for V3 users.

http://rysensoft.com/Verge/

At the time LUA wasn't involved, so it's purely VC, and there have been many changes to the engine since I wrote it, but it might help you get on the right track.

I also don't maintain or update anything regarding it, so the files in the Tutorial Package are incredibly out of date, and may or may not be there, but you should be able to take what's written and apply it to the latest engine downloads.

Best of luck :)

Posted on 2011-05-09 00:18:25

poopoopoo333

Well first of all "autoexec()" is mainly used for system.vc while instead you should use something like "MapInit" and second of all you most likely did not tell your map to run this ".vc" program! To do this you will want to open the map editor and go to map and then properties. The last thing it will ask for is the "Starting Script: " after that put the name of the function in there. For example if you wrote:

void MapInit()
{
int player=EntitySpawn(5, 5, "player.chr");
SetPlayer(player);
}

Posted on 2012-09-12 04:16:03

poopoopoo333

Well first of all "autoexec()" is mainly used for system.vc while instead you should use something like "MapInit" and second of all you most likely did not tell your map to run this ".vc" program! To do this you will want to open the map editor and go to map and then properties. The last thing it will ask for is the "Starting Script: " after that put the name of the function in there. For example if you wrote:

void MapInit()
{
int player=EntitySpawn(5, 5, "player.chr");
SetPlayer(player);
}

Then you would type in the Starting Script "MapInit". Save and run and it should work like a charm!!! :P

Posted on 2012-09-12 04:17:02

shubhg1996

Hello, I'm a newbie using mac :'(
can someone plz tell me if we can spawn entities witout using maped?

Posted on 2013-03-15 06:05:31

Keast

As documented, you can spawn entities with:

int currentplayer = EntitySpawn(10, 10, "Hero.chr");
SetPlayer(currentplayer);
entity.speed[currentplayer]=100;


What this does: create an int named currentplayer, make it a newly spawned entity on tile x = 10, y = 10 with sprite Hero.chr. Second line gives arrow key control over the entity, third line sets the movement speed (when using either EntityMove() or arrow keys or...).

Posted on 2013-03-24 03:40:40

shubhg1996

Originally by Keast:

As documented, you can spawn entities with:

int currentplayer = EntitySpawn(10, 10, "Hero.chr");
SetPlayer(currentplayer);
entity.speed[currentplayer]=100;


What this does: create an int named currentplayer, make it a newly spawned entity on tile x = 10, y = 10 with sprite Hero.chr. Second line gives arrow key control over the entity, third line sets the movement speed (when using either EntityMove() or arrow keys or...).


I still can't make the entity appear on the map...
Only a blank map is displayed...

Posted on 2013-03-24 13:34:00

Keast

Can you make sure this code definitly is being called? Just put "exit("");" at the end of it to test. If it is, you have to show us some more code, I just ran this snippet and it works like a charm. If it isn't being called and you don't know how to do that, tell me.

Posted on 2013-03-24 16:54:53


Displaying 1-14 of 14 total.
1
 
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.