Gamestudio Links
Zorro Links
Newest Posts
Executing Trades on Next Bar Open
by vicknick. 06/13/24 08:51
Zorro Beta 2.61: PyTorch
by jcl. 06/10/24 14:42
New FXCM FIX Plugin
by flink. 06/04/24 07:30
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/22/24 13:41
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
0 registered members (), 1,209 guests, and 0 spiders.
Key: Admin, Global Mod, Mod
Newest Members
AemStones, LucasJoshua, Baklazhan, Hanky27, firatv
19059 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 2 of 2 1 2
Re: A8 free wdl c-script [Re: 3run] #356870
02/04/11 15:23
02/04/11 15:23
Joined: Feb 2011
Posts: 26
J
jojo1995 Offline OP
Newbie
jojo1995  Offline OP
Newbie
J

Joined: Feb 2011
Posts: 26
Can you convert it to the lite-c

action mgun_function()
{
mgun = my; // I'm weapon1
var player1_pos; // stores the initial position of the player
var player2_pos; // stores the position of the player after a frame
var weapon_offset;
var weapon_height;
var front_offset = 30;
set(my,PASSABLE); // the weapon model is passable
while (!player) {wait (1);} // wait until the player is created
while (vec_dist (player.x, my.x) > 100) { wait (1);} // wait until the player comes close to pick up the weapon

while (1)
{
weapon_1=1;
vec_set (player1_pos.x, player.x); // store the initial player position
// place the weapon 50 quants in front, 18 quants to the right and 20 quants below camera's origin
vec_set (weapon_offset.x, vector (front_offset, -10, -10));
if (vec_dist (player1_pos.x, player2_pos.x) != 0) // the player has moved during the last frame?
{
weapon_height += 30 * time_step; // then offset weapon_height (30 = weapon waving speed)
weapon_offset.z += 0.3 * sin(weapon_height); // (0.3 = weapon waving amplitude)
}
// rotate weapon_offset according to the camera angles
vec_rotate (weapon_offset.x, vector (camera.pan, camera.tilt, 0));
vec_add (weapon_offset.x, camera.x); // add the camera position to weapon_offset
vec_set (my.x, weapon_offset.x); // set weapon's coords to weapon_offset
my.pan = camera.pan; // use the same camera angles for the weapon
my.tilt = camera.tilt;
vec_set (player2_pos.x, player.x); // store the new player coordinates after 1 frame
wait (1);
}

}

Re: A8 free wdl c-script [Re: jojo1995] #356871
02/04/11 15:26
02/04/11 15:26
Joined: Aug 2002
Posts: 2,183
Germany, BaW�
Rondidon Offline
Expert
Rondidon  Offline
Expert

Joined: Aug 2002
Posts: 2,183
Germany, BaW�
What exactly is the error? What does the engine complain about at game start?

Re: A8 free wdl c-script [Re: Rondidon] #356872
02/04/11 15:30
02/04/11 15:30
Joined: Feb 2011
Posts: 26
J
jojo1995 Offline OP
Newbie
jojo1995  Offline OP
Newbie
J

Joined: Feb 2011
Posts: 26
my project is c-script and I want to turn it into a lite-c

Re: A8 free wdl c-script [Re: jojo1995] #356897
02/04/11 17:07
02/04/11 17:07
Joined: Jan 2011
Posts: 65
R
reknak Offline
Junior Member
reknak  Offline
Junior Member
R

Joined: Jan 2011
Posts: 65
I don't think you have to change something about it (atleast not much). Did you already tried it using the GStudio8 script editor? You might also see the manual of GStudio8 for the lite-c programming language.

Page 2 of 2 1 2

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