ent_create problem

Posted By: sadsack

ent_create problem - 08/31/08 20:28

Hi,
well my first game in 3D GameStudio is coming alone fine.
Need a little help on this I am trying to put a missile at the same pos. as a ship.
code:
Code:

ent_create("missile1.mdl", vector(ship1 x,ship1 y,ship1 z),missile1);


syntext error.
I just don't know how to write it in lite-c
I hope someone can help.
Thank You
renny
Posted By: DJBMASTER

Re: ent_create problem - 08/31/08 20:41

it should be...

Code:
ent_create("missile1.mdl", vector(ship1.x,ship1.y,ship1.z),missile1);

we use the "." operator to access the properties of an object/struct.


Posted By: sadsack

Re: ent_create problem - 08/31/08 21:28

Hi,
what I am trying to do is when you press a key there is a missile created at the ship1 pos. this code should do that, but the missile never get load. I want to off set it so no coll. is taking place. new offset code:

Code:
action act_missile1()
{
	
	while(1)
	{
	if (key_b) {ent_create("missile1.mdl",vector(ship1.x ,ship1.y,ship1.offset_z=-100),missile1);}
	
		
		
		
	}
}





If I use this code above, the missile never loaded. but if I just load the missile like this it does load

Code:
in main

ent_create("missile1.mdl",vector(ship1.x ,ship1.y,ship1.z),missile1);}




But the offset code I got from the manual does not compile

Code:

ent_create("missile1.mdl",vector(ship1.x ,ship1.y,ship1.offset_z=-100),missile1);}




I hope you can understand what I am saying. I been working on this for three days now, I think it time a take a rest.
renny
Posted By: MrGuest

Re: ent_create problem - 08/31/08 21:59

lol, scripters never rest!!!

If I were you, I'd not create an event which is looking for a button press, (btw it's missing a wait(1); ) but instead only put it when the button is pressed. This won't save you a huge amount of fps, but it will save some later if you're running plenty of functions.

Also this will stop missles being created every frame, if b is held. so....

Code:
action missile1(){
	//your action in here
	//prob c_move
}

function create_missile(){
	if(ship1){ //makes sure ship1 exists
		ent_create("missile1.mdl", vector(ship1.x, ship1.y, ship1.z-100), missile1);
	}
}

void main(){
	on_b = create_missile;
}


NB I've not used your ship1.offset_x=-100, this wasn't setting anything

Hope this helps laugh
Posted By: Anonymous

Re: ent_create problem - 08/31/08 22:05


LoL! sadsack

I'm still Waiting For Magic.
For my Ace of Base....rather than a lot of pain,difficulty, questions, frustration and headaches coding.

And it doesn't make it any easier cause I do like
3D Game Studio...and especially the Lite C scripting language. But alas!

and with that said, I hope you find a solution and answer to your ent_create question/problem.

cheers
Posted By: sadsack

Re: ent_create problem - 08/31/08 22:13

yes, I do have lot of pain,difficulty, questions, frustration, headaches and melt downs. Hey old cat, I hope you had a nice weekend. I was with lite-c all week end. she is one mean woman. but I think I am winning her over.
renny

EDIT: cat if you want, I have a chat room on my site, few of us cheap game makers hang out there some time. www.thegusworks.com If you want to stop by and say hi let me know and I will let you know when we are going be htere.
rdh
Posted By: Anonymous

Re: ent_create problem - 09/01/08 03:32

haha, so true.
about the pain and difficulties.

But I met up with Ice Cube and he told me to go Torque or else he will kick my butt. wink

ahhhhhhhhh......



And Da Spokes Man for Torque Game Builder.


perhaps and sometime in the future...I will one day 'Command and Conquer' 3D Game Studio and Lite C.



cheers =)
Posted By: sadsack

Re: ent_create problem - 09/01/08 15:14

hey, cat sound good, if you want somenice free textures go here

http://www.thecodebrewers.com/Textures.html


will talk to you later, If you have time I will be at my chat room at 3 PM EST.
I think it is noon your time.

www.thegusworks.com
Posted By: sadsack

Re: ent_create problem - 09/01/08 15:31

Thanks MrGuest I will try your code out this very afternoon.
renny
Posted By: sadsack

Re: ent_create problem - 09/01/08 20:48

Well MrGuest, I got your code to work at last, made one small change in it.

Thank You
renny
© 2023 lite-C Forums