EOSERV Forum > Programming > Player Warp?
Topic is locked.
Page: << 1 >>
Player Warp?
Author Message
Post #196185 Player Warp?

Having trouble with player warp now, sorry for the spam.

Anyhow, I was following this guide; https://eoserv.net/forum/topic/9833

But I get multipul errors, everything is fine until I get to the part where I have to add the big code in talk.cpp

9 years, 23 weeks ago
Post #196186 Re: Player Warp?

Well, yeah, it figures, that code is from a super old revision. Later revisions have a different method of handling commands. You're going to have to do a lot of the figuring of this out yourself, but everything you need is in the source code.

As a starting point, look in src/handlers/Talk.cpp to see how chat from a normal player is handled (hint: Talk_Report function). You should see a block of code that says "If the first letter is $, do a command for whatever the rest of the message is". You'll need to add a separate check that says "If the first letter is #, do a command". Then you'll need to add in src/commands/warp.cpp a function that does basically what that thing you're trying to paste in Talk.cpp does (parse the warps config file, and warp the player where they're supposed to go). You'll need to rewrite it to work with the latest rev and add the associated call to CharacterRegister at the bottom.

For adding a player-level #warp in addition to the existing admin-level $warp, I'd add something like RegisterCharacter({"#warp", {"place"}}, PlayerWarp); at the bottom, and then a function void PlayerWarp(const std::vector<std::string>& args, Character * from) { /*... */ }. I know you'll be back for more help given your other topics, and that's fine, but try it out first and see how far you can get - http://www.cplusplus.com/reference/ and stackoverflow are great places to search for general programming topics. I'm assuming you're using Code::Blocks, so make good use of Right-clicking something and doing "Go to definition/Go to declaration", as well as "Find Occurances" and all the other good junk in that context menu too.

---
class EOSERV {
Programmer | Oldbie
Open source EO Client: https://github.com/ethanmoffat/EndlessClient
};
9 years, 23 weeks ago
Post #196187 Re: Player Warp?

I really hope you are using a more modern version of EOSERV than that. Anyway, you probably need to upgrade to the most recent version of EOSERV and use the EOMap program. If you need more specific parameters for warping you can start researching EO+ which is the quest scripting language which is implemented in modern versions of EOSERV.

9 years, 23 weeks ago
Page: << 1 >>
Topic is locked.
EOSERV Forum > Programming > Player Warp?