Raised This Month: $ Target: $400
 0% 

[TF2 & L4D & L4D2] Actions


Post New Thread Reply   
 
Thread Tools Display Modes
BHaType
Great Tester of Whatever
Join Date: Jun 2018
Old 06-09-2024 , 23:52   Re: [TF2 & L4D & L4D2] Actions
Reply With Quote #121

Updated

PHP Code:
All arguments passed to the plugin now undergo strict type checking, as opposed to regular pass-by-value as it was before (This caused CBaseEntity not to be converted to an entity index for SelectTargetPoint)
Some arguments of the callback prototypes are no longer strict to a specific type 
Now this works
Code:
methodmap MyNextBot
{
	public void SayMyName()
	{
		PrintToServer("MyNextBot");
	}
}

public void OnActionCreated(BehaviorAction action, int actor, const char[] name)
{
	action.SelectTargetPoint = SelectTargePoint;
}

public Action SelectTargePoint(BehaviorAction action, MyNextBot nextbot, int entity, float vec[3])
{
	nextbot.SayMyName();
	return Plugin_Continue;
}
__________________
cry

Last edited by BHaType; 06-11-2024 at 00:08.
BHaType is offline
Send a message via AIM to BHaType
awesome144
Senior Member
Join Date: Jul 2014
Location: In lala land
Old 06-11-2024 , 01:23   Re: [TF2 & L4D & L4D2] Actions
Reply With Quote #122

Quote:
Originally Posted by BHaType View Post
Updated

PHP Code:
All arguments passed to the plugin now undergo strict type checking, as opposed to regular pass-by-value as it was before (This caused CBaseEntity not to be converted to an entity index for SelectTargetPoint)
Some arguments of the callback prototypes are no longer strict to a specific type 
Now this works
Code:
methodmap MyNextBot
{
	public void SayMyName()
	{
		PrintToServer("MyNextBot");
	}
}

public void OnActionCreated(BehaviorAction action, int actor, const char[] name)
{
	action.SelectTargetPoint = SelectTargePoint;
}

public Action SelectTargePoint(BehaviorAction action, MyNextBot nextbot, int entity, float vec[3])
{
	nextbot.SayMyName();
	return Plugin_Continue;
}
This is a beautiful update, but for whatever reason this version crashes upon changing actions with the crash dump saying EXCEPTION_ACCESS_VIOLATION_READ accessing 0x0.
__________________
⎛⎝Officer Spy⎠⎞


awesome144 is offline
BHaType
Great Tester of Whatever
Join Date: Jun 2018
Old 06-11-2024 , 22:04   Re: [TF2 & L4D & L4D2] Actions
Reply With Quote #123

Updated

PHP Code:
Fixed the crash caused by an attempt to change the handler's return value even if it doesn't have one 

Last edited by BHaType; 06-11-2024 at 22:04.
BHaType is offline
Send a message via AIM to BHaType
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 02:39.


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