Hi,
I have made a Character* variable for 3 players which I have named RoboMan
I am using these to change the player via buttons:
button1
RoboMan = cSentinal;
RoboMan.SetAsPlayer();
button2
RoboMan = cExcalibur;
RoboMan.SetAsPlayer();
button3
RoboMan = cCenturian;
RoboMan.SetAsPlayer();
I should then be able to control the selected player with the command RoboMan I believe.
Such as:
RoboMan.Say("hello");
However it seems I am unable to add collision detection when using the PPC module, because error says it can't change strings to int.
if(PPColliding.CWithC(RoboMan,cpLANET1) && Game.DoOnceOnly("Planet found")){ // String error
OR
if(PPColliding.CWithC(player,cpLANET1) && Game.DoOnceOnly("Planet found")){ // only works with default player
Am I able to salvage this or is it a case of using x y collision maths?
help appreciated...
Could this be a matter of scope?
Is RoboMan set before you get to that statement?
before the if put something to display the contents of RoboMan like
Display(RoboMan.Name);
QuoteDisplay(RoboMan.Name);
Gives the Display as: RoboMan....as per variable name..
and i put it after the 'if' because in rep exec...
Really? I was expecting Sentinal or Excalibur or Centurian.
How is RoboMan defined? maybe we can display a different property to be sure it is setting properly.
QuoteReally? I was expecting Sentinal or Excalibur or Centurian.
It does now i have changed all the names from RoboMan.. (nod)
Edit:I'v got it to work plus:
SSH added this piece of updated script for PPC..
if(player.PPCollidesWithC(cpLANET1))
{
And still giving the String error? I am not familiar with the PPColliding module but tried to see why it would work for player.
Well i tried, but if you ever do get it to work I would be curious as to what was wrong.
Hi dayowlron
I don't know quite why it never worked and showed an error but somehow i overcame it.. Probably a script error by yours truly :-[
Glad you got it working
ALWAYS post the exact error message. "can't change String to int" means AGS encountered a String where it's expecting an int, so this has nothing to do with collision math or unassigned pointers.
The error message will point to the exact line, and also state multiple lines which point to the exact function calls and ultimately the offending line.
If you post asking about an error message, why not provide ALL the info, instead of making us resort to vague guesses? How long have we been doing this by now?