|
3 registered members (AndrewAMD, Grant, Neb),
908
guests, and 6
spiders. |
|
Key:
Admin,
Global Mod,
Mod
|
|
|
vec_for_vertex problem?
#260656
04/12/09 20:09
04/12/09 20:09
|
Joined: Apr 2009
Posts: 113 Netherlands
Dreher
OP
Warez Victim
|
OP
Warez Victim
Joined: Apr 2009
Posts: 113
Netherlands
|
Hello people!  I've been working some more, but for the moment I'm facing another problem. Here's the code for now:
action draaischijf_action()
{
var draaischijf_rotation_speed = 0.5;
var kruis_rotation_speed = 0.5;
vec_for_vertex(temp,my,6104);
vec_for_vertex(temp,my,6099);
vec_for_vertex(temp,my,6094);
vec_for_vertex(temp,my,6115);
vec_for_vertex(temp,my,6089);
vec_for_vertex(temp,my,6110);
/////////////////////Objects maken////////////////////////////
ent_create("kruis.mdl",vector(0,0,30),NULL);
ent_create("kruis.mdl",vector(0,0,30),NULL);
ent_create("kruis.mdl",vector(0,0,30),NULL);
ent_create("kruis.mdl",vector(0,0,30),NULL);
ent_create("kruis.mdl",vector(0,0,30),NULL);
ent_create("kruis.mdl",vector(0,0,30),NULL);
}
action kruis_action()
{
my.passable=on;//Passable moet aan, anders botst hij met de draaischijf
while(1)
{
vec_for_vertex(temp,my,6104);
my.x=temp.x;
my.y=temp.y;
my.z=temp.z;
wait(1);
}
}
Alright, these 'ent_create' parts containing 'NULL', but when I write 'kruis_action' so they'll look for their action within the 'action kruis_action()' list, gives me errors when running the script! I'm not sure if I did it correct or missing something.. Thanks in advance! 
A7 7.77
|
|
|
Re: vec_for_vertex problem?
[Re: Dreher]
#260658
04/12/09 20:17
04/12/09 20:17
|
Joined: Jun 2006
Posts: 2,640 Earth
Germanunkol
Expert
|
Expert
Joined: Jun 2006
Posts: 2,640
Earth
|
try putting the action above the draaischijf_action()? when looking at the line "ent_create..." the engine does not yet know the action kruis_action, because it hasn't gotten there yet.so try this:
action kruis_action()
{
my.passable=on;//Passable moet aan, anders botst hij met de draaischijf
while(1)
{
vec_for_vertex(temp,my,6104);
my.x=temp.x;
my.y=temp.y;
my.z=temp.z;
wait(1);
}
}
action draaischijf_action()
{
var draaischijf_rotation_speed = 0.5;
var kruis_rotation_speed = 0.5;
vec_for_vertex(temp,my,6104);
vec_for_vertex(temp,my,6099);
vec_for_vertex(temp,my,6094);
vec_for_vertex(temp,my,6115);
vec_for_vertex(temp,my,6089);
vec_for_vertex(temp,my,6110);
/////////////////////Objects maken////////////////////////////
ent_create("kruis.mdl",vector(0,0,30),NULL);
ent_create("kruis.mdl",vector(0,0,30),NULL);
ent_create("kruis.mdl",vector(0,0,30),NULL);
ent_create("kruis.mdl",vector(0,0,30),NULL);
ent_create("kruis.mdl",vector(0,0,30),NULL);
ent_create("kruis.mdl",vector(0,0,30),NULL);
}
edit: just looked at the code again: are you trying to set the entity to the position of it's own vertex?
Last edited by Germanunkol; 04/12/09 20:21.
~"I never let school interfere with my education"~ -Mark Twain
|
|
|
Re: vec_for_vertex problem?
[Re: Germanunkol]
#260659
04/12/09 20:25
04/12/09 20:25
|
Joined: Apr 2009
Posts: 113 Netherlands
Dreher
OP
Warez Victim
|
OP
Warez Victim
Joined: Apr 2009
Posts: 113
Netherlands
|
In both cases, the script will run.
I create 6 times 'kruis.mdl' and I want them to spawn on the 6 vec_for_vertex places of 'draaischijf.mdl'
Yet they won't go there, they all 6 stay in the middle of the 'draaischijf.mdl' object, which I don't want them to do!
So there is something missing in here for it to work^^
Thanks for helping though
Last edited by Dreher; 04/12/09 20:25.
A7 7.77
|
|
|
Re: vec_for_vertex problem?
[Re: Dreher]
#260660
04/12/09 20:35
04/12/09 20:35
|
Joined: Jun 2006
Posts: 2,640 Earth
Germanunkol
Expert
|
Expert
Joined: Jun 2006
Posts: 2,640
Earth
|
sorry... my bad. I wasn't looking careful enough and I was kind of tired. try this?
action kruis_action()
{
my.passable=on;//Passable moet aan, anders botst hij met de draaischijf
while(1)
{
you = ptr_for_handle(my.skill1);
vec_for_vertex(temp,you,6104);
my.x=temp.x;
my.y=temp.y;
my.z=temp.z;
wait(1);
}
}
action draaischijf_action()
{
var draaischijf_rotation_speed = 0.5;
var kruis_rotation_speed = 0.5;
/////////////////////Objects maken////////////////////////////
vec_for_vertex(temp,my,6104);
you = ent_create("kruis.mdl",temp,kruis_action);
you.skill1 = handle(my);
vec_for_vertex(temp,my,6094);
you = ent_create("kruis.mdl",temp,kruis_action);
you.skill1 = handle(my);
vec_for_vertex(temp,my,6115);
you = ent_create("kruis.mdl",temp,kruis_action);
you.skill1 = handle(my);
vec_for_vertex(temp,my,6089);
you = ent_create("kruis.mdl",temp,kruis_action);
you.skill1 = handle(my);
vec_for_vertex(temp,my,6110);
you = ent_create("kruis.mdl",temp,kruis_action);
you.skill1 = handle(my);
}by the way, are you using Lite-C or A6?
Last edited by Germanunkol; 04/12/09 20:35.
~"I never let school interfere with my education"~ -Mark Twain
|
|
|
Re: vec_for_vertex problem?
[Re: Germanunkol]
#260661
04/12/09 20:36
04/12/09 20:36
|
Joined: Apr 2009
Posts: 113 Netherlands
Dreher
OP
Warez Victim
|
OP
Warez Victim
Joined: Apr 2009
Posts: 113
Netherlands
|
I'll try that.. I use Lite-C with A7 Now 1 'kruis' is at the right place, but when I start, I get 5 or 6 BOING! messages containing: 'Error E1515' 'Invalid arguments in kruis_action: vec_for_vertex(temp,you,6104) lol^^ EDIT: Removed the vec_for_vertex within kruis_action(), but it only spawns 1 'kruis.mdl' while I want 6 of them  Weird...
Last edited by Dreher; 04/12/09 20:44.
A7 7.77
|
|
|
Re: vec_for_vertex problem?
[Re: Dreher]
#260673
04/12/09 22:38
04/12/09 22:38
|
Joined: Jun 2006
Posts: 2,640 Earth
Germanunkol
Expert
|
Expert
Joined: Jun 2006
Posts: 2,640
Earth
|
try replacing the line: my.passable=on; with: set(my,PASSABLE); the other line is old syntax, as far as I know. also, these three lines: my.x=temp.x; my.y=temp.y; my.z=temp.z; can be replaced by: vec_set(my.x,temp);
but neither of these should be causing the problem. it sounds to me like your model doesn't have 6115 vertecies...
could you try this: put: while(key_t == OFF){wait(1);} as the first line of action draaischijf_action() then run the script, press F11 and see the "count of ents" value. then press t and see how that count of ents changes... does it change?
~"I never let school interfere with my education"~ -Mark Twain
|
|
|
Re: vec_for_vertex problem?
[Re: Dreher]
#260675
04/12/09 22:46
04/12/09 22:46
|
Joined: Apr 2009
Posts: 113 Netherlands
Dreher
OP
Warez Victim
|
OP
Warez Victim
Joined: Apr 2009
Posts: 113
Netherlands
|
Yay! fixed the problem.  Now I need to find a way how to rotate something clockwise, and how to scale entitys ;P Any tips?  @ German I fixed it by removing the my.z=temp.z; / x / y etc Then it placed all 6 crosses on the platform. Yet when I use the following code: ang_rotate(my.pan,vector(1*time_step,0,0)); To rotate the platform, the 6 crosses stay at their place.. Shouldn't they move too? ^^
Last edited by Dreher; 04/12/09 23:05.
A7 7.77
|
|
|
|