Gamestudio Links
Zorro Links
Newest Posts
Newbie Questions
by fairtrader. 12/05/23 14:22
Zorro Trader GPT
by TipmyPip. 12/04/23 11:34
Square root rule
by Smallz. 12/02/23 09:15
RTest not found error
by TipmyPip. 12/01/23 21:43
neural function for Python to [Train]
by TipmyPip. 12/01/23 14:47
Xor Memory Problem.
by TipmyPip. 11/28/23 14:23
Training with command line parameters
by TipmyPip. 11/26/23 08:42
Combine USD & BTC Pairs In Asset Loop
by TipmyPip. 11/26/23 08:30
AUM Magazine
Latest Screens
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Who's Online Now
3 registered members (TedMar, AndrewAMD, fairtrader), 578 guests, and 0 spiders.
Key: Admin, Global Mod, Mod
Newest Members
fairtrader, hus, Vurtis, Harry5, KelvinC
19019 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
NEWBIE QUESTION #138132
06/26/07 05:03
06/26/07 05:03
Joined: Mar 2006
Posts: 6
D
developerno1 Offline OP
Newbie
developerno1  Offline OP
Newbie
D

Joined: Mar 2006
Posts: 6
hello guys ,
im a newbie and cant find any problem inthe code but sed gives a bunch of errors. please help..........

action player_right
{
entity right
right=my;
my.skin=skin_right
my.pan = 180;
if (my.shadow == off) { drop_shadow(); }
while ((right == null)) {wait (1);}

}
action player_left
{
entity left
left=my;
my.skin=skin_left
my.pan = 0;
if (my.shadow == off) { drop_shadow(); }
while ((left == null)) {wait (1);}
}

Re: NEWBIE QUESTION [Re: developerno1] #138133
06/26/07 05:10
06/26/07 05:10
Joined: Jul 2001
Posts: 6,904
H
HeelX Offline
Senior Expert
HeelX  Offline
Senior Expert
H

Joined: Jul 2001
Posts: 6,904
entity pointers have to be declared like this:

ENTITY* bla;

and have to be defined outside of a function, if you use CScript.

Re: NEWBIE QUESTION [Re: HeelX] #138134
06/26/07 05:22
06/26/07 05:22
Joined: Mar 2006
Posts: 6
D
developerno1 Offline OP
Newbie
developerno1  Offline OP
Newbie
D

Joined: Mar 2006
Posts: 6
ya ,
that was the prob. i couldnt find where to enter that , i did it under the variable declaration but the error was
"parameter unknown entity* inkeyword {}"
please help ..
im copying the whole code please point out the mistake
Code:


////////////////////////////////////////////////////////////////////////////
// The PATH keyword gives directories where template files can be found.
path "D:\\Program Files\\GStudio6\\template_6"; // Path to A6 templates directory
path "D:\\Program Files\\GStudio6\\template_6\\code"; // Path to A6 template code subdirectory
path "D:\\Program Files\\GStudio6\\template_6\\images"; // Path to A6 template image subdirectory
path "D:\\Program Files\\GStudio6\\template_6\\sounds"; // Path to A6 template sound subdirectory
path "D:\\Program Files\\GStudio6\\template_6\\models"; // Path to A6 template model subdirectory

/////////////////////////////////////////////////////////////////
// Filename of the starting level.
string level_str = <FIGHT.WMB>; // give file names in angular brackets

////////////////////////////////////////////////////////////////////////////
// Included files
include <gid01.wdl>; // global ids
include <display00.wdl>; // basic display settings
include <movement.wdl>; // libraries of WDL functions
include <messages.wdl>;
include <menu.wdl>; // menu must be included BEFORE doors and weapons
include <particle.wdl>; // remove when you need no particles

var right_health = 100;
var left_health = 100;
bmap left_health_map = "left_health.pcx";
bmap right_health_map = "right_health.pcx";
entity* ={left}
entity* ={right}


ifdef lores;
var video_mode = 4; // 320x240
ifelse;
var video_mode = 6; // 640x480
endif;
var video_depth = 16; // D3D, 16 bit resolution
var fps_max = 50; // 50 fps max

panel left_health_pan
{
pos_x = 20;
pos_y = 30;
layer = 1;
hbar = 0,0,200,left_health_map,2,left_health;
flags = d3d,overlay,refresh;
}


panel right_health_pan
{
pos_y = 30;
layer = 1;
hbar = 0,0,200,right_health_map,2,right_health;
flags = d3d,overlay,refresh;
}



/////////////////////////////////////////////////////////////////
// Desc: The main() function is started at game start
function main()
{
// set some common flags and variables
// freeze all entity functions
freeze_mode = 1;
// no level has been loaded yet...
gid01_level_state = gid01_level_not_loaded;

// entry: Warning Level (0,1, or 2)
// entry_help: Sets sensitivity to warnings (0 = none, 1 = some, 2 = all).
warn_level = 2; // announce bad texture sizes and bad wdl code
var video_screen = 1;

// entry: Starting Mouse Mode (0, 1, or 2)
mouse_mode = 0;

// wait 3 frames (for triple buffering) until it is flipped to the foreground
wait(3);

// now load the level
level_load(level_str);

wait(2); // let level load
// level should be loaded at this point...
gid01_level_state = gid01_level_loaded;

//+++ load starting values

// un-freeze the game
freeze_mode = 0;

right_health_pan.pos_x = screen_size.x - (bmap_width(right_health_map) + 20);
right_health_pan.visible = on;
left_health_pan.visible = on;
}

action player_right
{

right=my;
my.skin=skin_right
my.pan = 180;
if (my.shadow == off) { drop_shadow(); }
while ((right == null)) {wait (1);}

}
action player_left
{

left=my;
my.skin=skin_left
my.pan = 0;
if (my.shadow == off) { drop_shadow(); }
while ((left == null)) {wait (1);}
}

// Desc: this is the function used to restart the game.
function main_restart_game()
{
// wait 3 frames (for triple buffering) until it is flipped to the foreground
wait(3);

// now load the level
level_load(level_str);
// freeze the game
freeze_mode = 1;

wait(2); // 1-level loads, 2-entities load

//+++ load starting values

// un-freeze the game
freeze_mode = 0;
}


// Desc: this is the function used to quit the game.
function main_quit()
{
//+++ // save global skills & strings
exit;
}



/* no exit window at all..
WINDOW WINEND
{
TITLE "Finished";
SIZE 540,320;
MODE STANDARD;
BG_COLOR RGB(0,0,0);
TEXT_STDOUT "",RGB(255,40,40),10,20,520,270;

SET FONT "",RGB(0,255,255);
TEXT "Any key to exit",10,270;
}*/


/////////////////////////////////////////////////////////////////
//INCLUDE <debug.wdl>;



Re: NEWBIE QUESTION [Re: developerno1] #138135
06/26/07 09:30
06/26/07 09:30
Joined: Mar 2007
Posts: 776
Poor village - Poland ;)
tompo Offline
User
tompo  Offline
User

Joined: Mar 2007
Posts: 776
Poor village - Poland ;)
Quote:


entity* ={left}
entity* ={right}




should be without those {} just:
entity* left;
entity* right;

missing semicolons
my.skin=skin_right and my.skin=skin_left

Your code looks ugly... try to cutoff all those lines with "//" and empty lines

use sys_exit instead of exit
cheers
EDIT: @ Sorry Frazzle


Last edited by tompo; 06/26/07 09:45.

Never say never.
Re: NEWBIE QUESTION [Re: developerno1] #138136
06/26/07 09:30
06/26/07 09:30
Joined: Mar 2006
Posts: 2,758
Antwerp,Belgium
frazzle Offline
Expert
frazzle  Offline
Expert

Joined: Mar 2006
Posts: 2,758
Antwerp,Belgium
First I wanna say I never liked working with the templates but on the otherhand they are really helpful to beginner 3DGS game developers. At a first glance in your code, I see you've still declared your entities at a wrong way.
Try:
Code:
 
entity* left;
entity* right;



Instead of:
Code:
 
entity* ={left}
entity* ={right}



To make sure this code is bug free, post it in the template section, there are more users there how can help you out better then me because I've never used the templates. Btw, if you wanna learn to write your own code, just try out the AU resources and the AUM magazine, there are lots of useful item there
http://au.conitec.net/
http://www.conitec.net/english/gstudio/aum.htm

EDIT: Yeah, tompo is a quick fellow

Cheers

Frazzle

Last edited by frazzle; 06/26/07 09:32.

Antec® Case
Intel® X58 Chipset
Intel® i7 975 Quad Core
8 GB RAM DDR3
SSD OCZ®-VERTEX2 3.5 x4 ; HD 600 GB
NVIDIA® GeForce GTX 295 Memory 1795GB
Re: NEWBIE QUESTION [Re: frazzle] #138137
06/26/07 12:23
06/26/07 12:23
Joined: Mar 2006
Posts: 6
D
developerno1 Offline OP
Newbie
developerno1  Offline OP
Newbie
D

Joined: Mar 2006
Posts: 6
thanks very much man for the cooperation
i changed the
entity* ={left}
entity* ={right}
lines to...........
entity* ={left}
entity* ={right}
and that worked but another error comes up that says parameter unknown skin_right and skin_left ,do i have to define themas something?????????
please help , thanks in advance

Re: NEWBIE QUESTION [Re: developerno1] #138138
06/26/07 13:56
06/26/07 13:56
Joined: Jul 2001
Posts: 6,904
H
HeelX Offline
Senior Expert
HeelX  Offline
Senior Expert
H

Joined: Jul 2001
Posts: 6,904
Well, when you do my.skin = skin_right;, skin_right should be at least a variable which stores the number of the skin like "var skin_right = 4; //fourth skin" or at least a define like "define skin_right = 4;", although you should notice that defines are constants. I cannot see a variable declaration for skin_right or skin_left, so it should be fixed if you add these necessary variables.


Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1