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,251 guests, and 5 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 1 of 2 1 2
Scripting problem (Solved!) #313883
03/04/10 12:10
03/04/10 12:10
Joined: Mar 2010
Posts: 29
L
lollollollollol Offline OP
Newbie
lollollollollol  Offline OP
Newbie
L

Joined: Mar 2010
Posts: 29
Hey,

I have this problem: I want to put a zombie inside a jail, where he slams against the jailbars.

I have the zombie.mdl already, with animations. And now I wwant to loop this action, so he slams the jail bars all the time.

i use this script atm, got it from tutorial.3dgamestudio.net:

#include <acknex.h>
#include <default.c>


var attack_percentage;
function main()
{
video_mode = 7;
level_load ("Huis.wmb");
wait (2); // wait until the level is loaded
camera.z = 120; // choose a convenient height
camera.tilt = -15; // and tilt angle for the camera
}
action attack()
{
while (1)
{
ent_animate(my,"attack",walk_percentage, ANM_CYCLE); // "walk" animation loop
walk_percentage += 3 * time_step; // 3 = animation speed for "walk"
wait (1);
}
}


Prob is, I didnt load any zombie in the script, so he aint on the map yet.. and how do I call up his jailslam animation, as the tutorial isnt very clear and I tried every option i thought was nessecary.
Pleease help laugh i need this very much!

Thanks by lollollollollol

edit: I know there is still a walk animation located in this script etc.. but i really dont get the scripting part, and as everyone started once... I really could use your guys help with making a better script..or explaining how i can load the animation of jailslam.

Last edited by lollollollollol; 03/05/10 08:05.
Re: Scripting problem [Re: lollollollollol] #313888
03/04/10 13:14
03/04/10 13:14
Joined: Oct 2009
Posts: 110
Porto-Portugal
Elektron Offline
Member
Elektron  Offline
Member

Joined: Oct 2009
Posts: 110
Porto-Portugal
For load the model use this code after level load:
Code:
model_zombie=ent_create("zombie.mdl",vector(0,0,0),NULL);


Replace zombie.mdl for the name of your model.
And vector(0,0,0) to the coords where you want to place your model.
For animate:
Code:
ent_animate(model_zombie,"jailslam",walk_percentage, ANM_CYCLE);


Replace jailslam for the name of your animation.

I hope this helps.
Cheers


Carlos Ribeiro aka Elektron
Check my blog: http://indiegamedeveloper71.wordpress.com/
Re: Scripting problem [Re: Elektron] #313892
03/04/10 13:24
03/04/10 13:24
Joined: Mar 2010
Posts: 29
L
lollollollollol Offline OP
Newbie
lollollollollol  Offline OP
Newbie
L

Joined: Mar 2010
Posts: 29
#include <acknex.h>
#include <default.c>


var walk_percentage;

function main()
{
video_mode = 7;
level_load ("Huis.wmb");
model_zombie=ent_create("zombiek.mdl",vector(0,0,0),NULL)
wait (2); // wait until the level is loaded
camera.z = 120; // choose a convenient height
camera.tilt = -15; // and tilt angle for the camera
}

action attack()
{
while (1)
{
ent_animate(model_zombie,"attack",walk_percentage, ANM_CYCLE); // "walk" animation loop
walk_percentage += 3 * time_step; // 3 = animation speed for "walk"
wait (1);
}
}

Now it says that there is an error in this script. anyone knows why?

Re: Scripting problem [Re: lollollollollol] #313902
03/04/10 13:55
03/04/10 13:55
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline
Senior Expert
Superku  Offline
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
#include <acknex.h>
#include <default.c>

action attack()
var walk_percentage;
{
while (1)
{
ent_animate(me,"attack",walk_percentage, ANM_CYCLE); // "walk" animation loop
walk_percentage += 3 * time_step; // 3 = animation speed for "walk"
walk_percentage %= 100;
wait (1);
}
}

function main()
{
video_mode = 7;
level_load ("Huis.wmb");
wait (2); // wait until the level is loaded
ent_create("zombiek.mdl",vector(0,0,0),attack)
camera.z = 120; // choose a convenient height
camera.tilt = -15; // and tilt angle for the camera
}



"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual

Check out my new game: Pogostuck: Rage With Your Friends
Re: Scripting problem [Re: Superku] #313906
03/04/10 14:02
03/04/10 14:02
Joined: Dec 2008
Posts: 1,660
North America
Redeemer Offline
Serious User
Redeemer  Offline
Serious User

Joined: Dec 2008
Posts: 1,660
North America
You must create the object after the level has loaded...

Code:
level_load ("Huis.wmb");
wait (2); // wait until the level is loaded
ent_create("zombiek.mdl",vector(0,0,0),attack)


Otherwise the script will crash!


Eats commas for breakfast.

Play Barony: Cursed Edition!
Re: Scripting problem [Re: Redeemer] #313912
03/04/10 14:15
03/04/10 14:15
Joined: Mar 2010
Posts: 29
L
lollollollollol Offline OP
Newbie
lollollollollol  Offline OP
Newbie
L

Joined: Mar 2010
Posts: 29
Thats the same as I did.. You just copied a part of my script?

Re: Scripting problem [Re: lollollollollol] #313913
03/04/10 14:16
03/04/10 14:16
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline
Senior Expert
Superku  Offline
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
You're wrong.


"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual

Check out my new game: Pogostuck: Rage With Your Friends
Re: Scripting problem [Re: Superku] #313914
03/04/10 14:22
03/04/10 14:22
Joined: Mar 2010
Posts: 29
L
lollollollollol Offline OP
Newbie
lollollollollol  Offline OP
Newbie
L

Joined: Mar 2010
Posts: 29
instead of saying youre wrong laugh , could you say what is wrong about it, or give me an example of what it should be? please laugh

Re: Scripting problem [Re: lollollollollol] #313921
03/04/10 15:02
03/04/10 15:02
Joined: Oct 2009
Posts: 110
Porto-Portugal
Elektron Offline
Member
Elektron  Offline
Member

Joined: Oct 2009
Posts: 110
Porto-Portugal
Please pay attention.
The order of level load, wait and ent_create is no the same as you did.


Carlos Ribeiro aka Elektron
Check my blog: http://indiegamedeveloper71.wordpress.com/
Re: Scripting problem [Re: Elektron] #313947
03/04/10 16:54
03/04/10 16:54
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline
Senior Expert
Superku  Offline
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Have you had a look at my post/code ?!?


"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual

Check out my new game: Pogostuck: Rage With Your Friends
Page 1 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