Gamestudio Links
Zorro Links
Newest Posts
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
Change chart colours
by 7th_zorro. 05/11/24 09:25
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (flink, VoroneTZ, AndrewAMD), 1,230 guests, and 7 spiders.
Key: Admin, Global Mod, Mod
Newest Members
AemStones, LucasJoshua, Baklazhan, Hanky27, firatv
19056 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
ent_create( ... doesn't load model / lädt das Modell nicht #280395
07/22/09 14:12
07/22/09 14:12
Joined: Jul 2009
Posts: 36
S
SomebodyNew Offline OP
Newbie
SomebodyNew  Offline OP
Newbie
S

Joined: Jul 2009
Posts: 36
Hello everyone,

I've started with gamestudio and just completed your tutorials. Well... I just ran into a problem.

I'm trying to learn the basics so i write really short scripts to see if and how they work. So that one day... =) Well, this one didn't work. Honestly, I don't see why.

/////////////////////////////
#include <acknex.h>
#include <default.c>
/////////////////////////////
function main();
function spawn_object();
/////////////////////////////
function main()
{
level_load("Test1.wmb"); //load the level
camera.z = 1000; //move the camera
camera.tilt = -90; //look "down"
wait(1);
}

function spawn_object()
{
ent_create("kugel.mdl", vector(0,0,0), NULL);
wait(1); //Not sure if this one is needed.
}

on_u = spawn_object();


Gamestudio does load the level, but pressing the button "u" doesn't create the model.
I've put all files (level, script, textures, models) in one directory.

Thank you for taking the time to look at my script.

---------------------------------------------------------

Hallo,
bin absoluter Anfänger mit Gamestudio und versuche mit kleinen Scripts c-lite zu erlernen. Mit obenstehendem Script habe ich ein kleines Problem - und weiß wirklich nicht woran es liegt. Hab schon im Handbuch nachgeschlagen, bin leider nicht auf den Fehler gestoßen. Zwar lädt das level, nur passiert nichts, wenn man die Taste "u" drückt.
Alle Dateien befinden sich in einem Ordner (level, texturen, model und scripte)

Bin für jeden Tipp dankbar.

Gruß,
SombodyNew

Re: ent_create( ... doesn't load model / lädt das Modell nicht [Re: SomebodyNew] #280397
07/22/09 14:18
07/22/09 14:18
Joined: Aug 2008
Posts: 2,838
take me down to the paradise c...
Cowabanga Offline
Expert
Cowabanga  Offline
Expert

Joined: Aug 2008
Posts: 2,838
take me down to the paradise c...
Because you didn't gave the world's gate time to open wink.

Replace function main by this:
Click to reveal.. (You don't wanna see this)
Code:
function main()
{
	level_load("Test1.wmb"); //load the level
	wait(4); // CRITICAL MASS =P
	camera.z = 1000; //move the camera
	camera.tilt = -90; //look "down"
}



EDIT:
Quote:

Gamestudio does load the level, but pressing the button "u" doesn't create the model.
I was totally wrong then, let me take a closer look to your code.

Last edited by Cowabanga; 07/22/09 14:21.
Re: ent_create( ... doesn't load model / lädt das Modell nicht [Re: SomebodyNew] #280399
07/22/09 14:19
07/22/09 14:19
Joined: Feb 2008
Posts: 3,232
Australia
EvilSOB Offline
Expert
EvilSOB  Offline
Expert

Joined: Feb 2008
Posts: 3,232
Australia
change on_u = spawn_object(); to on_u = spawn_object;
AND put it inside main somewhere.


"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial
Re: ent_create( ... doesn't load model / lädt das Modell nicht [Re: EvilSOB] #280401
07/22/09 14:22
07/22/09 14:22
Joined: Aug 2008
Posts: 2,838
take me down to the paradise c...
Cowabanga Offline
Expert
Cowabanga  Offline
Expert

Joined: Aug 2008
Posts: 2,838
take me down to the paradise c...
Originally Posted By: EvilSOB
change on_u = spawn_object(); to on_u = spawn_object;
AND put it inside main somewhere.
I gotta get my coffee. FAST!! grin
You're right.

Re: ent_create( ... doesn't load model / lädt das Modell nicht [Re: Cowabanga] #280403
07/22/09 14:27
07/22/09 14:27
Joined: Feb 2008
Posts: 3,232
Australia
EvilSOB Offline
Expert
EvilSOB  Offline
Expert

Joined: Feb 2008
Posts: 3,232
Australia
hehehe


"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial
Re: ent_create( ... doesn't load model / lädt das Modell nicht [Re: EvilSOB] #280409
07/22/09 14:40
07/22/09 14:40
Joined: Jul 2009
Posts: 36
S
SomebodyNew Offline OP
Newbie
SomebodyNew  Offline OP
Newbie
S

Joined: Jul 2009
Posts: 36
Wow! That were some fast answers.
Thank you! It works now.

If you have to write "on_u" in the main function. Does that mean that you can call functions via your keyboard only from within a function/main function? If so, could you just write a function that includes all on_key lines and call this function from the main function?
Something like

function main()
{
...code...
call hotkeys;
}

function hotkey()
{
on_a = ...;
on_b = ...;
etc...
}

again, thanks for helping
(hope you don't mind these basic questions)

Re: ent_create( ... doesn't load model / lädt das Modell nicht [Re: SomebodyNew] #280414
07/22/09 14:55
07/22/09 14:55
Joined: Feb 2008
Posts: 3,232
Australia
EvilSOB Offline
Expert
EvilSOB  Offline
Expert

Joined: Feb 2008
Posts: 3,232
Australia
Yes you can.
The on_xx commands set the function (as an event) to the xx key.
So once the on_xx has been processed, no matter where the code is NOW,
if the xx key is pressed, the event(your function) is triggered at the
next frame, or the end of this frame, Im not sure of that.

To disable the event, just execute an on_xx=NULL; and the event is released,
and the xx key no longer triggers any functions.


"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial
Re: ent_create( ... doesn't load model / lädt das Modell nicht [Re: EvilSOB] #280415
07/22/09 15:01
07/22/09 15:01
Joined: Jul 2009
Posts: 36
S
SomebodyNew Offline OP
Newbie
SomebodyNew  Offline OP
Newbie
S

Joined: Jul 2009
Posts: 36
Hey EvilSOB,
I think i understand now how it works.
Thank you for the quick response and the explanation!

Re: ent_create( ... doesn't load model / lädt das Modell nicht [Re: SomebodyNew] #280418
07/22/09 15:07
07/22/09 15:07
Joined: Nov 2007
Posts: 1,143
United Kingdom
DJBMASTER Offline
Serious User
DJBMASTER  Offline
Serious User

Joined: Nov 2007
Posts: 1,143
United Kingdom
I never understood why you have to omit the () when using a on_xx command.

Is it because with (), the function will be executed and it's return value will be assigned to on_xx. So without the (), you are passing a pointer to the function?



Last edited by DJBMASTER; 07/22/09 15:08.
Re: ent_create( ... doesn't load model / lädt das Modell nicht [Re: DJBMASTER] #280423
07/22/09 15:32
07/22/09 15:32
Joined: Aug 2003
Posts: 7,439
Red Dwarf
Michael_Schwarz Offline
Senior Expert
Michael_Schwarz  Offline
Senior Expert

Joined: Aug 2003
Posts: 7,439
Red Dwarf
yes, thats how it works.


"Sometimes JCL reminds me of Notch, but more competent" ~ Kiyaku
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