Page 1 of 1
.createnpc error
Posted: Fri Jul 30, 2010 10:24 pm
by roquettedu
I have on POL95 here and when i try to create a npc like: .createnpc horse and click on somewhere occurs one error:
NPC Creation Failed:
Parameter 4 bust be a Struct or Integer (0) , got Struct
What does it means, someone knows how can i fix it ?
Re: .createnpc error
Posted: Fri Jul 30, 2010 10:32 pm
by Basara
post part or all of your createnpc script?
Re: .createnpc error
Posted: Sat Jul 31, 2010 12:02 am
by roquettedu
Code: Select all
use uo;
Use cfgfile;
Use file;
Include "include/time";
program textcmd_createnpc( who, template )
if( !template )
SendSysMessage( who, "Usage is .createnpc <template>" );
return;
endif
var props := struct;
props.+facing := who.facing;
var loc := TargetCoordinates(who);
var result := CreateNpcFromTemplate( template, loc.x, loc.y, loc.z, props );
if( !result )
SendSysMessage( who, "NPC Creation Failed: " + result.errortext );
else
LogEditing( Who, result );
endif
endprogram
Function LogEditing( Who, Npc )
If( !Who || !Npc )
Return 0;
Endif
Var TEXT_Logged := Array;
Var Seconds := PolCore().SysTime;
Var Date := GetDateString( Seconds ) + " :: " + GetTimeString( Seconds );
TEXT_Logged.Append( "Created " + Date );
TEXT_Logged.Append( "Staff " + Who.name + " [" + Hex( Who.serial ) + "] - [" + Who.ip + "]" );
TEXT_Logged.Append( "NPC " + Npc.name + " [" + Hex( Npc.serial ) + "]" );
TEXT_Logged.Append( "Location " + Npc.x + " " + Npc.y + " " + Npc.z );
TEXT_Logged.Append( "" );
TEXT_Logged.Append( "" );
AppendToFile( "data/logging/Created_NPCs.txt", TEXT_Logged );
Return 1;
Endfunction
Re: .createnpc error
Posted: Thu Aug 05, 2010 5:12 am
by zed
var props := struct;
props.+facing := who.facing;
check:
var props array;
props.+facing := who.facing;
Re: .createnpc error
Posted: Fri Dec 10, 2010 7:42 pm
by andenixa
I am having a similar error in my npc creation script:
var props := struct;
props.+facing := who.facing;
var result := CreateNpcFromTemplate( template, loc.x, loc.y, loc.z, props );
Resulting in SysMsg:
Parameter 4 bust be a Struct or Integer (0) , got Struct
As a side note I think all rabid people who do:
var something array;
Should be put down before they actually hurt someone.
Along with those who discovered and armed the array/struct aberration without consent.
Re: .createnpc error
Posted: Sat Dec 11, 2010 12:16 pm
by Austin
andenixa wrote:I am having a similar error in my npc creation script:
Should be put down before they actually hurt someone.
Along with those who discovered and armed the array/struct aberration without consent.
Same for those still using POL 095... That thing is like 9 years old!
Re: .createnpc error
Posted: Sat Dec 11, 2010 8:29 pm
by andenixa
I appreciate your answer and fully aware of the fact that most of those are probably fixed in new cores. But its next thing to impossible to leap for a new core if your script-base is 9 years old unless you're are up for a total rewrite which just isn't feasible.