|
Posted by RenTechie on 05/06/06 16:14
I get this error:
Parse error: parse error, unexpected $ in [file] on line 63
Where [file] is the path and filename for a file containing:
<?php
function cityname($style="10engdir eng 50engloc"){//creates name for city
return 'a city';
};
function powercentres($pop){//determines power centres for a city
return array(1=>array('name'=>'pc1','align'=>'true
neutral','views'=>array(1=>'self'),'type'=>'conventional'));
$pcs=array();
if($pop<=80){
$roll=rand(1,20);
$align=rand(1,100);
if($align<=35){
$pcs[1]=array('align'=>'lawful good');
}elseif($align<=39){
$pcs[1]=array('align'=>'neutral good');
}elseif($align<=41){
$pcs[1]=array('align'=>'chaotic good');
}elseif($align<=61){
$pcs[1]=array('align'=>'lawful neutral');
}elseif($align<=63){
$pcs[1]=array('align'=>'true neutral');
}elseif($align<=64){
$pcs[1]=array('align'=>'chaotic neutral');
}elseif($align<=90){
$pcs[1]=array('align'=>'lawful evil');
}elseif($align<=98){
$pcs[1]=array('align'=>'neutral evil');
}else{
$pcs[1]=array('align'=>'chaotic evil');
}
if($roll-1<=13){
$pcs[1]['type']='conventional';
if(rand(1,20)==1){
}elseif($roll-1<=18){
$pcs[1]['type']='nonstandard';
}else{
$pcs[1]['type']='magical';
}
};
function npc($pop){//creates NPC population of city
return
array(1=>array('name'=>'npc1','lvl'=>array('ftr'=>1),'race'=>'human','stats'=>array('int'=>10,'wis'=>10,'str'=>10,'dex'=>10,'cha'=>10,'con'=>10),'saves'=>array('f'=>2,'r'=>1,'w'=>1),'ac'=>10,'align'=>'true
neutral','skills'=>20,'feats'=>2,'gear'=>'gear','spells'=>''));
};
function sherrif($npcs){//chooses the sherrif
return 1;
};
function makecity($pop){//creates stats for 1 city
$city=array(
'name'=>cityname(),
'pop'=>$pop,
'urbanarea'=>($pop/38850),//38,850 people per square mile
'supportarea'=>($pop/180),//1 square mile can support 180 people
'powercentres'=>powercentres($pop),
'NPCs'=>npc($pop),
'fulltimeLEO'=>floor($pop/100),//1 LEO per 100 people (DMG)
'conscriptable'=>floor($pop/20)//1 conscriptable individual per 20 pop
(DMG)
);
$city['sherrif']=sherrif($city['NPCs']);
return($city);
}
?>
I know that some of the functions are returning before they do anything
(I'm going bugeyed and want to make sure the overall works). What's
this error from?
TIA,
RT
If you wanna email me, remove the "SPAM."
Navigation:
[Reply to this message]
|