Gamestudio Links
Zorro Links
Newest Posts
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
Help with plotting multiple ZigZag
by degenerate_762. 04/30/24 23:23
M1 Oversampling
by 11honza11. 04/30/24 08:16
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (ChrstphFr, AndrewAMD, dr_panther), 865 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
firatv, wandaluciaia, Mega_Rod, EternallyCurious, howardR
19050 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
local vectors work, but skill vectors wont #147652
08/13/07 03:58
08/13/07 03:58
Joined: Apr 2002
Posts: 1,246
ny
jumpman Offline OP
Serious User
jumpman  Offline OP
Serious User

Joined: Apr 2002
Posts: 1,246
ny
hello all.

Im trying to make George's perfect AI more modular for multiple entites. Im running into problems dealing with vectors that are created inside the entity action opposed to vectors defined in skills.

action blah
{
var current_node_vec3[3];

}

Above is an example of creating vectors inside the entity. This vector works fine with:

current_node_vec3.x = nodex[path2[my.local_i]];
current_node_vec3.y = nodey[path2[my.local_i]];
current_node_vec3.z = nodez[path2[my.local_i]];

The entity will look towards the correct position using vec_to_angle.

However when I try to use skills to define vectors:

var current_node_vec4,skill8;
var current_node_vec4,skill9;
var current_node_vec4,skill10;

the following dosent work:

current_node_vec4.x = nodex[path2[my.local_i]];
current_node_vec4.y = nodey[path2[my.local_i]];
current_node_vec4.z = nodez[path2[my.local_i]];


EVERY pathfinding entity will look towards one node, giving me the feeling that the current_node_vec4 vector is being seen as a global vector, even though it is defined as a skill.

When I revert back to the vector being created inside the entity action, the entities work fine, and look at their own personal nodes in their own paths.

There are no other skills that the entity is using that would take up the same skill numbers as the defined skills.

I'm 99% sure its not a pathfinding problem.

Re: local vectors work, but skill vectors wont [Re: jumpman] #147653
08/13/07 06:18
08/13/07 06:18
Joined: Sep 2002
Posts: 700
Orange County, CA
L
LogantheHogan Offline
Developer
LogantheHogan  Offline
Developer
L

Joined: Sep 2002
Posts: 700
Orange County, CA
Hm, this line doesn't make sense to me:

var current_node_vec4,skill8;

Looks like you meant DEFINE instead? But if you change it to DEFINE it's going to give you a bunch of errors because you'd have to access it through MY.current_node_vec4 instead of current_node_vec4.x or whatever, and you can't use my.current_node_vec.x. What's the problem with defining the vector inside a function? I think it's a far superior way, and frankly I'm surprised you're not getting a bunch of compiler errors with the code you currently have.

edit: sorry if that sounded at all rude. not intended whatsoever.

Last edited by LogantheHogan; 08/13/07 06:21.
Re: local vectors work, but skill vectors wont [Re: LogantheHogan] #147654
08/13/07 08:47
08/13/07 08:47
Joined: Apr 2002
Posts: 1,246
ny
jumpman Offline OP
Serious User
jumpman  Offline OP
Serious User

Joined: Apr 2002
Posts: 1,246
ny
I wanted to define skills so that I can make functions that reference these skills. Instead of writing the lines over again for every state change. This is so I can have different actions pathfinding, without writing all these lines over again.

Defining a vector in a function? Can the entity calling this function store the vector like a skill?

Re: local vectors work, but skill vectors wont [Re: jumpman] #147655
08/13/07 09:50
08/13/07 09:50
Joined: Jul 2002
Posts: 4,436
Germany, Luebeck
Xarthor Offline
Expert
Xarthor  Offline
Expert

Joined: Jul 2002
Posts: 4,436
Germany, Luebeck
Code:

define vector_x,skill20;
define vector_y,skill21;
define vector_z,skill22;

var test_vec[3] = 5,10,15;

action entity_act
{
vec_set(my.vector_x,test_vec);
// ...
my.vector_z += 30;
}


All code above is example code and should run with no errors.


Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

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