HomePortalFAQSearchMemberlistUsergroupsRegisterLog in
Meet the new KITO admins & hear their plans here.
You can use google search to find threads and posts here now. Example

Share | 
 

 PvP Player vs Player stuff

View previous topic View next topic Go down 
AuthorMessage
RedEye
Retired
avatar

Game username : -redeye-
Server : KITO
Male Posts : 2578
Join date : 2011-07-24
Age : 30

PostSubject: PvP Player vs Player stuff   Tue Nov 18, 2014 11:09 am

Note: The forum can't search for 3 letters and fewer.

In the function processNewPlayer(Packet *p) in MagixNetworkManager
Find the line of code (https://github.com/jespersh/KITO/blob/master/src/client/include/MagixNetworkManager.h#L714 the code on the link is subject to change, so the line number might change):
Code:
tUnit->setAlliance(ALLIANCE_FRIEND);
Replace it with:
Code:
if (mDef->getMapName(mWorld->getWorldName()) == "World Center") {
 tUnit->setAlliance(ALLIANCE_ENEMY);
}
else if (mDef->getMapName(mWorld->getWorldName()) == "Other mappvp") {
 tUnit->setAlliance(ALLIANCE_ENEMY);
}
else if (mDef->getMapName(mWorld->getWorldName()) == "third map") {
 tUnit->setAlliance(ALLIANCE_ENEMY);
}
else {
 tUnit->setAlliance(ALLIANCE_FRIEND);
}
Add, delete, replace the case strings with your map names. The maps you add as cases will have other players as attackable

________________________________
Retired


Last edited by RedEye on Tue Nov 18, 2014 11:26 pm; edited 1 time in total
Back to top Go down
Hyper
Admin
avatar

Game username : Hyper
Server : Azoptaos
Male Posts : 489
Join date : 2014-02-09
Age : 19

PostSubject: Re: PvP Player vs Player stuff   Tue Nov 18, 2014 9:58 pm

Tried to input this code but I get

c:\users\azoptaos\desktop\azoptaos source\src\client\include\MagixNetworkManager.h(715): error C2450: switch expression of type 'const Ogre::String' is illegal
         No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
c:\users\azoptaos\desktop\azoptaos source\src\client\include\MagixNetworkManager.h(716): error C2051: case expression not constant
c:\users\azoptaos\desktop\azoptaos source\src\client\include\MagixNetworkManager.h(722): warning C4065: switch statement contains 'default' but no 'case' labels

Code:
switch (mDef->getMapName(mWorld->getWorldName())) {
 case "The Void":
 tUnit->setAlliance(ALLIANCE_ENEMY);
 break;
 default:
 tUnit->setAlliance(ALLIANCE_FRIEND);
 break;
 }

________________________________
Back to top Go down
http://azoptaos.boards.net/
RedEye
Retired
avatar

Game username : -redeye-
Server : KITO
Male Posts : 2578
Join date : 2011-07-24
Age : 30

PostSubject: Re: PvP Player vs Player stuff   Tue Nov 18, 2014 11:27 pm

Should proof read my topics. Or at least check if I intended to add the wrong code entirely.
Fixed.

________________________________
Retired
Back to top Go down
Hyper
Admin
avatar

Game username : Hyper
Server : Azoptaos
Male Posts : 489
Join date : 2014-02-09
Age : 19

PostSubject: Re: PvP Player vs Player stuff   Tue Nov 18, 2014 11:40 pm

Much better, haha. Thank you very much for posting this, Redeye!

________________________________
Back to top Go down
http://azoptaos.boards.net/
Revaen
Very Helpful
Very Helpful


Male Posts : 314
Join date : 2013-07-21
Age : 16

PostSubject: Re: PvP Player vs Player stuff   Wed Nov 19, 2014 12:04 am

Yep:
Spoiler:
 

Thank you for making this code RedEye, it is really interesting to have these features in-game.
Now it will be really interesting make bets around, eh?
Back to top Go down
GlaciaTheWolf
®
®
avatar

Game username : Glacia, GlaciaIceWolf, GlaciaTheWolf
Server : DD (member) Wolf soul (member)
Female Posts : 1001
Join date : 2013-12-09
Age : 21
Location : Ohio

PostSubject: Re: PvP Player vs Player stuff   Sat Feb 07, 2015 3:52 am

RedEye wrote:

Code:
if (mDef->getMapName(mWorld->getWorldName()) == "World Center") {
 tUnit->setAlliance(ALLIANCE_ENEMY);
}
else if (mDef->getMapName(mWorld->getWorldName()) == "Other mappvp") {
 tUnit->setAlliance(ALLIANCE_ENEMY);
}
else if (mDef->getMapName(mWorld->getWorldName()) == "third map") {
 tUnit->setAlliance(ALLIANCE_ENEMY);
}
else {
 tUnit->setAlliance(ALLIANCE_FRIEND);
}
Add, delete, replace the case strings with your map names. The maps you add as cases will have other players as attackable

If you only have one map for pvp, you only need one of these?
Back to top Go down
Hyper
Admin
avatar

Game username : Hyper
Server : Azoptaos
Male Posts : 489
Join date : 2014-02-09
Age : 19

PostSubject: Re: PvP Player vs Player stuff   Sat Feb 07, 2015 5:25 am

glaciaicewolf wrote:
If you only have one map for pvp, you only need one of these?

Yep:

Code:
if (mDef->getMapName(mWorld->getWorldName()) == "map name") {
 tUnit->setAlliance(ALLIANCE_ENEMY);
}
else {
 tUnit->setAlliance(ALLIANCE_FRIEND);
}

________________________________
Back to top Go down
http://azoptaos.boards.net/
GlaciaTheWolf
®
®
avatar

Game username : Glacia, GlaciaIceWolf, GlaciaTheWolf
Server : DD (member) Wolf soul (member)
Female Posts : 1001
Join date : 2013-12-09
Age : 21
Location : Ohio

PostSubject: Re: PvP Player vs Player stuff   Sun Feb 08, 2015 4:21 am

Thanks hyper Smile

Edit awsome it works!
Back to top Go down
Skyia

avatar

Game username : Skyia
Server : Royal Elements
Female Posts : 144
Join date : 2014-09-14
Age : 17
Location : In your mind

PostSubject: Re: PvP Player vs Player stuff   Sun Feb 15, 2015 12:17 am

How would we get the server waring away?
Back to top Go down
Rihard

avatar

Game username : Mikuru Saiko
Server : Eternal Time
Female Posts : 76
Join date : 2014-03-12
Age : 20
Location : Germany

PostSubject: Re: PvP Player vs Player stuff   Mon Aug 10, 2015 1:46 pm

I can't kill my friend.
Why?
This code doesn't work or another?
Back to top Go down
-INACTIVE-
Texture Artist
Texture Artist


Male Posts : 447
Join date : 2014-05-03

PostSubject: Re: PvP Player vs Player stuff   Mon Aug 10, 2015 1:53 pm

Rihard wrote:
I can't kill my friend.
Why?
This code doesn't work or another?

Are you sure your code is writen like this?
Code:
if (mDef->getMapName(mWorld->getWorldName()) == "World Center") {
 tUnit->setAlliance(ALLIANCE_ENEMY);
}
Back to top Go down
Nakti
®
®
avatar

Game username : Nakti
Server : World of Pandora
Female Posts : 164
Join date : 2012-08-24
Age : 22
Location : black celebration

PostSubject: Re: PvP Player vs Player stuff   Mon Aug 10, 2015 3:51 pm

Removed.
Back to top Go down
Rihard

avatar

Game username : Mikuru Saiko
Server : Eternal Time
Female Posts : 76
Join date : 2014-03-12
Age : 20
Location : Germany

PostSubject: Re: PvP Player vs Player stuff   Fri Aug 14, 2015 10:32 am

Quote :
Cyris ßlack♥
Are you sure your code is writen like this?


Yes
Back to top Go down
Sponsored content




PostSubject: Re: PvP Player vs Player stuff   

Back to top Go down
 
PvP Player vs Player stuff
View previous topic View next topic Back to top 
Page 1 of 1

Permissions in this forum:You cannot reply to topics in this forum
Keeping I.T. Open :: DOWNLOADABLE CONTENT :: Programming Features-
Jump to: