Originally Posted By: tolu619
Originally Posted By: 3run
Originally Posted By: tolu619
The topic creation thing must have been on User Resources by default, I didn't edit it at all. I didn't even notice the option to do so.
You can create topics under almost any forum here, next time ask for help under "Lite-C Programming".

Yes sir! Can't I change which forum my topic falls under myself after creation?
I'm not sure if you can do this.

Originally Posted By: tolu619
Thanks, 3run!
I was finally able to solve it. For some reason, global variables didn't work. So I declared the variables inside my player's function and extracted the numbers like so:
Code:
function PlayerMovementFunction(MONSTER* Mon)
{
	STRING* AbyssNameString = str_create("");
    STRING* AbyssNumberString = str_create("");
    STRING* TempString =  str_create("#10");
while(1)
	{
		vec_set(vMin,my.x);
        vec_set(vMax,my.x);
        vec_add(vMin,my.min_x);
        vec_add(vMax,my.max_x);
        
        //CHECK IF PLAYER HAS FALLEN INTO AN ABYSS REGION, THEN RESPAWN HIM AT CORRESPONDING RESPAWN POINT
        if(region_find(AbyssNameString, my.x))//check if ent is in region & store name of region
        {
        	str_cpy(TempString, AbyssNameString);
        	TempString = str_cut(NULL, AbyssNameString, 1, 5); //store first 5 letters in TempString
            if(str_cmpi(TempString, "Abyss")) //if the region is an abyss
            {
        	    str_cpy(AbyssNumberString, AbyssNameString);
        	    str_clip(AbyssNumberString, 5); //Delete first 5 characters then store resulting number
                if(region_check(AbyssNameString,vMin,vMax))
                {
             	   vec_set(my.x, Player1RespawnPosition[str_to_num(AbyssNumberString)]); 
                }        	
            }        
        }


I decided to name any Abyss region that isn't a double digit as Abyss01, Abyss02, etc. It still works that way, and I doubt I'LL ever have up to 99 Abysses in a level, so I can safely hard code lines like "str_clip(AbyssNumberString, 5);" knowing that my Abyss region names are always 5 letters followed by 2 digits.
I'm happy that you've got it to work. But be aware that 'str_clip' will change 'AbyssNumberString', so you'll have to copy saved region name into it each time before 'clipping' it. You can easily change the code, so it will check for 999 regions as well, but only if you need this.

Greets


Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung