ecompile.exe problem pol-core-Beta-x64-2016-10-15

Bug reports and feature requests.
Post Reply
guialtran
Journeyman Poster
Posts: 68
Joined: Wed Jul 30, 2008 12:42 pm

ecompile.exe problem pol-core-Beta-x64-2016-10-15

Post by guialtran » Mon Apr 10, 2017 10:18 am

First of all, I'm sorry, I do not speak English.


I encountered a problem, when I was converting some old pol 95 scripts to the pol-core-Beta-x64-2016-10-15.

Using two constants within one (if (1 == 1)), generates an internal problem in the compiler.

The program does not know how to perform the function.
(PlayObjectCenteredEffectex), and when I put it.
(Print ("" + PlayObjectCenteredEffect (...))
Or the program closes.
20170410134009-0.dmp

Code: Select all

Use os;
Use uo;
program usea( character )
	erro(  Target( character )  );
endprogram

function erro( character )
	if( 1 == 1 )
		if(1 == 1)
			PlayObjectCenteredEffectex(character,14089,0,30);
		elseif( 2 == 1 )
			print(2);
		endif
	endif
endfunction
OR

Code: Select all

Use os;
Use uo;

const A := 1;
const B := 1;
const C := 2;
program usea( character )
	erro(  Target( character )  );
endprogram

function erro( character )
	if( A == B )
		if(B == A)
			//sleepms(1);
			print(""+PlayObjectCenteredEffect(character,14089,1,30));// CRASH POL
			//PlayObjectCenteredEffect(character,14089,0,30);
		elseif( B == C )
			print(2);
		endif
	endif
endfunction

Can someone tell me if this is normal?

It is forbidden to place two constants inside if (), example (if (1 == 1))?

i ADD arquive CRASH 20170410140946-0.dmp
Attachments
20170410140946-0.dmp
(70.07 KiB) Downloaded 2 times

Yukiko
Distro Developer
Posts: 1960
Joined: Thu Feb 02, 2006 1:41 pm
Location: San Antonio, Texas
Contact:

Re: ecompile.exe problem pol-core-Beta-x64-2016-10-15

Post by Yukiko » Mon Apr 10, 2017 4:18 pm

I'm not sure what you are attempting to accomplish with the "if" statements but if you want the character to target an object and have the effect appear on the object you will need to assign a variable to the object reference returned by the function Target as in my example below:

Code: Select all

Use os;
Use uo;
program usea( character )
	var targ := Target( character );
	erro(targ);
endprogram

function erro( targ )
	if( 1 == 1 )
			PlayObjectCenteredEffectex(targ,14089,0,30);
			print(2);
		
	endif
endfunction
I will note that the effect only appeared when I targetted a mobile. It should appear for any object such as a dynamically (in game) placed item. When I added the "elseif(2 ==1)" after the PlayObjectCenteredEffectex statement I didn't get the flame effect either. See below:

However POL didn't crash when I ran your original code either. I used your first example.

This programme doesn't work.

Code: Select all

Use os;
Use uo;
program usea( character )
	var targ := Target( character );
	erro(targ);
endprogram

function erro( targ )
	if( 1 == 1 )
			PlayObjectCenteredEffectex(targ,14089,0,30);
	elseif(2 == 1)
			print(2);
		
	endif
endfunction
Sincerely,
Yukiko

I would tell you a UDP joke but you might not get it.

Titus 2:13

guialtran
Journeyman Poster
Posts: 68
Joined: Wed Jul 30, 2008 12:42 pm

Re: ecompile.exe problem pol-core-Beta-x64-2016-10-15

Post by guialtran » Mon Apr 10, 2017 7:22 pm

This program has no purpose.
I want to show that when you use this pol with this code, the pol crash.
And I mean that the compiler is generating a faulty code when I put constants inside the if ()

Yukiko
Distro Developer
Posts: 1960
Joined: Thu Feb 02, 2006 1:41 pm
Location: San Antonio, Texas
Contact:

Re: ecompile.exe problem pol-core-Beta-x64-2016-10-15

Post by Yukiko » Tue Apr 11, 2017 12:20 am

Oh. My apologies. You're doing the work of the angels, and a good bug tester; trying to break something we think works. :)

Also, it's good to find "crash points" because these are often exploited by hackers.

Thanks for pointing this out.

I thought your code looked strange :P Now I know why.
Sincerely,
Yukiko

I would tell you a UDP joke but you might not get it.

Titus 2:13

guialtran
Journeyman Poster
Posts: 68
Joined: Wed Jul 30, 2008 12:42 pm

Re: ecompile.exe problem pol-core-Beta-x64-2016-10-15

Post by guialtran » Tue Apr 11, 2017 3:07 am

Was a very old pol 95 code (with problem) 2k lines
I've erased everything.
That was left
I hope it helped you.

I think it should generate a compilation error when the programmer puts 2 constants inside an if, because this does not make sense.

PS: Could you explain why this(crash) happens?

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest