Code that worked in 2.70 doesn't work in 2.71 (SOLVED)

Started by cjhrules, Fri 07/04/2006 02:51:19

Previous topic - Next topic

cjhrules

Code: ags

function character6_a() {
  // script for character1: Look at character

DisplaySpeech (EGO, "xxxxxxxxxxxxxxx");
DisplaySpeech (EGO, "xxxxxxxxxxxxxxxx"); 
SetCharacterView (EGO, 45);
Wait (20);
ReleaseCharacterView (EGO);


When I choose look at nothing happens. only works with objects and hotspots but not with characters after updating to 2.71.

Gilbert

Odd, did you turn on the "Enforce object-based scripting" option accidentally ? (though I think in that case the script may not even compile)

Also, check that if that "run-script" action is still in the appropiate interaction (look at that character) of the interaction editor (you didn't just copy function codes directly into the script right?), if not try create another "run-script" action and cut that portion there in the newly created function.

cjhrules

This is insane. I can't  interact with any character in anyway since I started on the AGS 2.71.

Gilbert

Did you check the interaction editor for the characters?

cjhrules

yep, I can add whatever I want to whatever I want. My maincharacter still wont preform the action. This is really strange.

SSH

Doe the character have the "clickable" box checked?
12

cjhrules

Yeah but it behaves just like if it hasn't. Exept you can see the characters name when holding the mouse over them.

Edit:

Can I have done something wrong when I updated the foa template myself?! This is really really bad....

Peder 🚀

I not sure about this, but try putting this instead of the code you wrote here.

Code: ags

cEGO.Say("xxxxxxxxxx");Ã,  
cEGO.Say("xxxxxxxxxxxxx");
cEGO.LockView(45);
Wait(20);
cEGO.UnlockView();


hope this helped.

Gilbert

Though the original should work if he didn't checked the "Enforce object-based scripting" option.

Also, please check whether the character's name is indeed EGO, in case they might got changed during the upgrade.

cjhrules

sorry, but it didn't work. Not even the "pre-defined" scripts works. I simply can't get EGO to interact with other characters. Is there anyone I can send the script to that knows AGS well and have time to fix this?

Note: the name of the char is EGO and I can interact with everything but characters.

Gilbert

If your game is not very large you can zip your game and upload it for us to examine, for your problem I think only the following files are enough for verifying (room files not needed):

ac2game.dta
editor.dat
acsprset.spr

cjhrules


Peder 🚀

Ok, I downloaded, tested it, and I dunno whats wrong.
Though, I thought I could just test to add an object to see if that worked, and it did.
You can do actions on objects and items, but appearantly not characters.......

I guess you probably allready knew?

anyway, I still looking on it.... Ill let you know if I find something unless Gilbot V7000a finds the problem...

cjhrules

Ok, great to hear. I can't redo everything in AGS 2.7 again because I have already done the intro and a part of the demo in this version. I have also imported most of the characters already, so I really hope someone can get this working.

Gilbert

It's a scripting problem, and because of the nest of functions it took me ages to trace the problem.

Just look in the global script the function GoToCharacter() (search for GoToCharacter( ), there's a line that reads (last line of function):
WalkToCharacterEx(GetPlayerCharacter(),charid,direction,defaultxoffset,defaultyoffset,NPCfacesplayer,blocking);

Change it to the following and try again:
return WalkToCharacterEx(GetPlayerCharacter(),charid,direction,defaultxoffset,defaultyoffset,NPCfacesplayer,blocking);

cjhrules

YEAHH! It's working. Thx m8! I owe you one ;)


Carl-Johan

SMF spam blocked by CleanTalk