Raised This Month: $ Target: $400
 0% 

Solved Change entity class | Orpheu


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 01-30-2017 , 09:28   Change entity class | Orpheu
Reply With Quote #1

Hello. I was wondering,

1. Is it possible changing a player's class? Like if you aim at an entity and press "G" you'll become that entity. I've tried different methods but none worked, the idea came from Garry's Mod.

2. What can Orpheu be used for ? I just can't understand this module, it has weird this such as OrpheuHook, OrpheuFunction etc..

3. Which is the best way to set player model ( Without using extra APIs such as Connor's ) ?

Thank you.
__________________

Last edited by edon1337; 02-11-2017 at 11:29.
edon1337 is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 01-30-2017 , 10:37   Re: Change entity class | Orpheu
Reply With Quote #2

1.What would be the purpose for that? It does not make sense.
2.Orpheu/okapi allows you to hook functions from game dlls(engine and mod dll), which can help you do awesome things. You can also play with memory and private data.
Take for example hamsandwich, all it does is to hook some virtual functions from game. View orpheu as an extended hamsandwich, it does not limit you to some predefined functions like ham does. It gives you the power to hook and call almost all functions. The only thing that you need is a signature file so the module can identify the function. OrpheuRegisterHook is the same as RegisterHam, it registers a hook for a specific function. In order get the function based on the signature file, OrpheuGetFunction is used.

For example, let's say you want to force a round end. The classic way is to kill all players, which is a poor and unreliable way. Game uses a function called CHalfLifeMultiplay::CheckWinConditions to determine when a round should end. If we have access to that function, we can call it and end the round. For that, one can use orpheu/okapi.
__________________

Last edited by HamletEagle; 01-30-2017 at 10:45.
HamletEagle is offline
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 01-30-2017 , 10:52   Re: Change entity class | Orpheu
Reply With Quote #3

1. You might want to check this , it actually is pretty cool.
2. Wow, that sounds cool, can you provide an example on how to force round end?

Thank you
__________________
edon1337 is offline
EFFx
Veteran Member
Join Date: Feb 2016
Location: São Paulo, Brasil
Old 01-30-2017 , 10:58   Re: Change entity class | Orpheu
Reply With Quote #4

1. Its not like AMXX.
2. https://forums.alliedmods.net/showthread.php?p=1122356
__________________
• Ranking System • AutoMix 5vs5 System
• Web Ban System • Plugins for free

____________________________________________
For private works:
• Discord: EFFEXo#8850 • Steam: EFFEXo
EFFx is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 01-30-2017 , 11:21   Re: Change entity class | Orpheu
Reply With Quote #5

2.It depends in which scenario, see Arkshine plugin for a way to do it properly. You have to create the conditions before calling the function. For example, if you want to end the round in a defuse map, you have to either set m_bTargetBombed(t will win) or m_bBombDefused(ct will win) offsets so the checks from the function are passed and the round will end. You can see the code in the mod source code(multiplay_gamerules.cpp file).
__________________

Last edited by HamletEagle; 01-30-2017 at 11:21.
HamletEagle is offline
PRoSToTeM@
Veteran Member
Join Date: Jan 2010
Location: Russia, Ivanovo
Old 01-30-2017 , 20:27   Re: Change entity class | Orpheu
Reply With Quote #6

Quote:
Originally Posted by edon1337 View Post
1. Is it possible changing an entity's class? Like to transform weapon_ak47 into func_button. I've tried different methods but none worked, the idea came from Garry's Mod.
Why not just delete old entity and create a new one?
__________________
PRoSToTeM@ is offline
Send a message via ICQ to PRoSToTeM@ Send a message via Skype™ to PRoSToTeM@
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 01-31-2017 , 07:54   Re: Change entity class | Orpheu
Reply With Quote #7

@Hamlet Okay thanks, Orpheu looks more complicated compared to other modules.
@Prost Sorry my explanation was wrong, I want you to become the entity you see.
__________________

Last edited by edon1337; 01-31-2017 at 07:56.
edon1337 is offline
EFFx
Veteran Member
Join Date: Feb 2016
Location: São Paulo, Brasil
Old 01-31-2017 , 18:30   Re: Change entity class | Orpheu
Reply With Quote #8

What PRoSToTeM@ said makes sense. You can make a stock for create a new entity.

PHP Code:
stock create_entity(entClass[], Float:entSizeFloat:LastEntityOrigin) .... 
Pick the last entity origin and put it in the new one. It will spawn him where the last entity was.
__________________
• Ranking System • AutoMix 5vs5 System
• Web Ban System • Plugins for free

____________________________________________
For private works:
• Discord: EFFEXo#8850 • Steam: EFFEXo

Last edited by EFFx; 01-31-2017 at 21:44.
EFFx is offline
yas17sin
Veteran Member
Join Date: Oct 2016
Location: Morocco/Sale
Old 01-31-2017 , 21:40   Re: Change entity class | Orpheu
Reply With Quote #9

@edon1337 yes it is very cool if you can change into something like Gmod.
yas17sin is offline
Send a message via ICQ to yas17sin
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 02-01-2017 , 07:36   Re: Change entity class | Orpheu
Reply With Quote #10

Quote:
Originally Posted by EFFx View Post
What PRoSToTeM@ said makes sense. You can make a stock for create a new entity.

PHP Code:
stock create_entity(entClass[], Float:entSizeFloat:LastEntityOrigin) .... 
Pick the last entity origin and put it in the new one. It will spawn him where the last entity was.
..
Quote:
Originally Posted by edon1337 View Post
@Prost Sorry my explanation was wrong, I want you to become the entity you see.
__________________
edon1337 is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 20:49.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode