where AGS stores the path info

Started by Besh, Thu 02/03/2006 08:02:54

Previous topic - Next topic

Besh

Excused if I post here but I didn't know who to address.

I'd like to know where/what AGS stores the info about the character walk and if they are usable from the script orÃ,  from the plugin interface???

eg.
When I click on the screen in WalkToMode the engine calculates the entire path then looks for collision or simply stores only the destination point and updates the positionÃ,  every cycle or ...?Ã,  ???

"Spread our codes to the stars,
You can rescue us all"
- Muse

Pumaman

Currently you cannot access the character's movement path, because nobody has ever wanted to do so.

What sort of thing would you want to do with it?

Besh

As you'll sure have understood, every question that I make is turned to the improvement of the Character3D plugin.

Currently I'm trying to solve two problems:

1) the character turns itself in strange positions for the distance to carry out (8 directions are enough in a 2d world  but not in a 3d one)

2) the speed of the character doesn't diminish with the distance

I think that to be able to use such variable can solve this problems, an alternative could be to put a new event (I'm talking about the AGS plugin API) between  AGSE_PRESCREENDRAW and AGSE_PREGUIDRAW in which the position and in a generalized manner all the variable relative to the character are updated and the character has not been still painted.

eg.
...
Call AGSE_PRESCREENDRAW
update variable
Call AGSE_NEWEVENT
Draw objects and characters
Call AGSE_PREGUIDRAW
...

I do not know...
...what do you think?
"Spread our codes to the stars,
You can rescue us all"
- Muse

Kweepa

For (2) you could use the continuous scaling of walkable areas combined with the "Adjust Speed With Scaling" checkbox of the character.

Although obviously if CJ somehow gave you access to the characters' pathfinding path point array you could move and rotate the character much more smoothly.
Still waiting for Purity of the Surf II

Besh

QuoteFor (2) you could use the continuous scaling of walkable areas combined with the "Adjust Speed With Scaling" checkbox of the character.

I have tried to use those property but it is complicated setting them in a correct way, specially for the people who uses C3D.
I'd like to do an automatic procedure, transparent for the user, tha solve this problem.
"Spread our codes to the stars,
You can rescue us all"
- Muse

Pumaman

So what would you want? Just access to the X/Y array of the waypoints in the character's movement path?

Besh

Yes... maybe... I don't know

The question is?? In the X/Y array of the waypoints in the character's movement path there's stored only the final point or also all the intermediate ones (I'm sorry for my English).
eg.
If I write player.walk(x,y) in the array there's only the point(x,y)??

However I think that acces the X/Y array of the waypoints in the character's movement path can solve my problem.Ã,  :)
"Spread our codes to the stars,
You can rescue us all"
- Muse

Pumaman

When the Walk() command is called AGS calculates the path and stores all the waypoints such that the character can move in a straight line between them in order to reach his destination.

Would you want to be able to change these, or just to read them?

Besh

I hoped worked in this way.  ;D

It would be better to be able to modify them.

Thanks very much!!
"Spread our codes to the stars,
You can rescue us all"
- Muse

Pumaman

AGS stores the X/Y co-ordinates of each waypoint, as well as the character X & Y speeds necessary to move between each point; so as long as you didn't modify the current one that the character was currently moving on, it would probably be ok...

Besh

Do you think to put these variable accessible only from the script or also from the plugin?
"Spread our codes to the stars,
You can rescue us all"
- Muse

Pumaman

I would say this should only be available from plugins, I don't think that the game script should ever be fiddling with something this internal; unless anyone has any objections to that?

Besh

"Spread our codes to the stars,
You can rescue us all"
- Muse

Scorpiorus

Hehe, once I needed to know the destination X,Y co-ordinates calculated by the pathfinder, before a character actually starts moving. But I have to admit that were under quite specific circumstances -- I used it to implement a certain puzzle, if I recall correctly.

I workarounded it by using another invisible dummy character to fastly go though the same path before. That forced me run the pathfinder routine twice in a row, though.

I can see a situation when one may find it useful to look for such data (well not the whole path array or speeds, but destination X:Y) to, for example, mark location where the player character is going to move to. If that's how user interface is designed to assist players in some way.

Anyway, probably it's not something to be used frequently and even if it is, we can always use plugin API to retrieve the necessary info.

SMF spam blocked by CleanTalk