About Store Forum Documentation Contact



Post Reply 
FAll()
Author Message
Dynad Offline
Member

Post: #1
FAll()
Hey,

Im trying to use the FAll() func but he doesnt access the GetWaypoints() at all, ive no idea whats wrong...

PHP Code:
Memb<Game::Waypoint *> weg;
void GetWaypoints(CChar *path)
{
    
Str8 name Replace(path"world/sample.world/Game/Waypoint"S);
    if (
Contains(name"Weg")) 
        
weg.New() = Game::World.getWaypoint(name);
    
}
/******************************************************************************/
void Player::create(Game::ObjParams &obj)
{
    
__super::create(obj);
}

Bool Init()
{
   
Text_ds.scale*=0.8;

   
Physics.create();
   
Sky    .atmospheric();
   
Sun.image=Images("gfx/sky/sun.gfx"); Sun.light_color=1-D.ambColor();

   
Game::World.init(                       )
                .
setObjType(Players,OBJ_PLAYER)
                .New (
"world/sample.world");

FAll("world/sample.world/Game/Waypoint"GetWaypointstrue);

   return 
true;


There is always evil somewhere, you just have to look for it properly.
(This post was last modified: 07-12-2010 09:47 PM by Dynad.)
07-12-2010 09:45 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Zervox Offline
Member

Post: #2
RE: FAll()
what is it that you want to do with the waypoints?
07-12-2010 11:25 PM
Find all posts by this user Quote this message in a reply
Dynad Offline
Member

Post: #3
RE: FAll()
That is not the point, the func is not being called :(

There is always evil somewhere, you just have to look for it properly.
07-12-2010 11:33 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Zervox Offline
Member

Post: #4
RE: FAll()
whats
Code:
Str8 name = Replace(path, S + "world/sample.world/Game/Waypoint", S);

that last S? Whats it for?

also, I see that you have(CCHAR *path) in getWaypoints, but nowere do you return that info or set the info. EDIT: Nevermind you set it inside the func

I wonder about that Str8 name, where you then Replace path,
then you make it check if it contains(name,"Weg"))
but you just set name to be a path not a name
(This post was last modified: 07-12-2010 11:50 PM by Zervox.)
07-12-2010 11:41 PM
Find all posts by this user Quote this message in a reply
Dynad Offline
Member

Post: #5
RE: FAll()
Look at the tutorial "fileFind" and you will understand smile

There is always evil somewhere, you just have to look for it properly.
07-12-2010 11:48 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Zervox Offline
Member

Post: #6
RE: FAll()
Actually only thing I can see in common is you using the FAll command : S

Should it not be in update in general? or atleast be executed from update?
init only runs it once, meaning it will not check for it again.
07-12-2010 11:55 PM
Find all posts by this user Quote this message in a reply
Dynad Offline
Member

Post: #7
RE: FAll()
Ah good point, i think im way too long busy at coding today pfft

There is always evil somewhere, you just have to look for it properly.
07-13-2010 12:00 AM
Visit this user's website Find all posts by this user Quote this message in a reply
Zervox Offline
Member

Post: #8
RE: FAll()
Yeah, I can see that, I myself make ALOT of mistakes, insomnia doesnt help.

But I am still curious what that function is doing/ going to do if you wouldnt mind telling? ^^ Maybe I can learn a few things ^^
(This post was last modified: 07-13-2010 12:09 AM by Zervox.)
07-13-2010 12:02 AM
Find all posts by this user Quote this message in a reply
Driklyn Offline
Member

Post: #9
RE: FAll()
(07-12-2010 09:45 PM)Dynad Wrote:  Im trying to use the FAll() func but he doesnt access the GetWaypoints() at all

GetWaypoints() is automatically called inside of FAll().

Code:
Str8 name = Replace(path, S + "world/sample.world/Game/Waypoint", S);
FAll("world/sample.world/Game/Waypoint", GetWaypoints, true);

Be sure to include the Data folder with these two lines as these two functions do not use the defined IOPath().

(07-12-2010 11:41 PM)Zervox Wrote:  
Code:
Str8 name = Replace(path, S + "world/sample.world/Game/Waypoint", S);

that last S? Whats it for?

S is an empty string. The way FAll() works, it returns the path + name of the file, not just the name, so you remove the path by using Replace() to replace the path with an empty string (S). This is necessary because Game::World.getWaypoint() only needs the name of the waypoint, not the path as well.

(07-12-2010 11:55 PM)Zervox Wrote:  init only runs it once, meaning it will not check for it again.

You only need to check for the waypoints once because after that, they are stored inside the Memb container.

(07-13-2010 12:02 AM)Zervox Wrote:  But I am still curious what that function is doing/ going to do if you wouldnt mind telling? ^^ Maybe I can learn a few things ^^

This function essentially allows you to differentiate between multiple "types" of waypoints in a world and then apply custom coding to each type.

For example, you might have six total waypoints in a world: three that should be used for bot pathing, two that should be used as ladders, and one that should teleport you from one point to the other (like a portal). Calling this function will separate each "type" of waypoint into the correct Memb container so you could then loop through them and call the custom code as needed.

Here's how to make ladders using this function: http://www.esenthel.com/wiki/index.php?t..._Waypoints
07-13-2010 07:47 AM
Find all posts by this user Quote this message in a reply
Post Reply