lucid's Recent Forum Activity

  • there isn't a way unfortunately

    also, I should warn you, motion blur greatly reduces the performance on some systems

    there were caps that didn't have a hint of slowdown on my pc, and when I posted them here, people would complain they were unplayably slow and choppy

  • [quote:1474t2ta]and if someone knows how this could work just the same without the detector sprite, please let me know

    What does the detector have to do with stepping? stepping just makes it so that you can check for fast moving collisions without skipping through objects. Or was that just an additional question?

    I think he was using it for the "push out" on solids.

    Also, I'm not even sure you need to do stepping for something like this.

    I'd be willing to bet Davo could do a platform movement with one condition using control states.

    yeah, I know Davo could

    and you're right it's so it will hit the wall from the sides, and stay on top of the ground moving at the normal speed

  • elevator test for an early version of my game

    http://dl.dropbox.com/u/1013446/output.mkv

  • sometimes when using the platform behavior it's difficult to implement features that would require the platformer to temporarily ignore certain types of obstacles. For instance, an elevator carrying a platformer through the next floor will stay on the next floor after the elevator moves past if the floor is a platform, or will hit the ceiling and fall if it's a solid. Stairways are much more difficult to implement for the same reasons, and the added trouble that they are always in the way on the bottom floor and impossible to get to through the top floor. Those are the first examples that come to mind, but there are other cases, mostly moving platform scenarios, but other things, like ladders, or ghosts that can phase through walls the character can't, but should still obey the ground.

    The following proposed additions are to alleviate this problem by allowing the behavior to temporarily ignore user-specified object types.

    the altered files are here:

    http://dl.dropbox.com/u/1013446/platform/Platform.rar

    and the changes are summarized below:

    changes:

    in MAIN:

    added one vector for objecttypes to ignore, and the function for checking the ignore list

    	vector<CRunObjType*> ignorelist;
    	bool IsIgnoring(CRunObjType* objtype);[/code:vtkaqhm8]
    
    ACETABLE:
    added three actions,  Add Object to ignore list, Remove Object from ignore list, and Clear ignore list
    [code:vtkaqhm8]	ADDPARAM(PARAM_OBJECT, "ObjectType to Ignore", "Ignore platforms and solids of this object type");
    	ADDACT("Add Object to ignore list", "Ignore", "Add %0 to ignore list", &ExtObject::aAddToIgnoreList, "AddToIgnoreList", 0);
    	ADDPARAM(PARAM_OBJECT, "ObjectType to Stop Ignoring", "Stop Ignoring platforms of this object type");
    	ADDACT("Remove Object from ignore list", "Ignore", "Remove %0 from ignore list", &ExtObject::aRemoveFromIgnoreList, "RemoveFromIgnoreList", 0);
    	ADDACT("Clear ignore list", "Ignore", "Clear ignore list", &ExtObject::aClearIgnoreList, "ClearIgnoreList", 0);[/code:vtkaqhm8]
    	
    ACTIONS:
    implement the three actions with simple vector commands, doublechecking to make sure the user doesn't add the same type twice
    [code:vtkaqhm8]	long ExtObject::aAddToIgnoreList(LPVAL theParams)
    	{
    		for(int i=0;i<ignorelist.size();i++)
    		{
    			if (ignorelist[i]==theParams->GetObjectParam(pRuntime))
    				return 0;
    		}
    		ignorelist.push_back(theParams->GetObjectParam(pRuntime));
    		return 0;
    	}
    	//ADDPARAM(PARAM_OBJECT, "Object to Stop Ignoring", "Stop Ignoring platforms of this object type");
    	//ADDACT("Remove Object from ignore list", "Ignore", "Remove %0 from ignore list", &ExtObject::aRemoveFromIgnoreList, "RemoveFromIgnoreList", 0);
    
    	long ExtObject::aRemoveFromIgnoreList(LPVAL theParams)
    	{
    		
    		for(int i=0;i<ignorelist.size();i++)
    		{
    			if (ignorelist[i]==theParams->GetObjectParam(pRuntime))
    			{
    				vector<CRunObjType*>::iterator it=ignorelist.begin()+i;
    				ignorelist.erase(it);
    			}
    		}
    		return 0;
    	}
    	//ADDACT("Clear ignore list", "Ignore", "Clear ignore list", &ExtObject::aClearIgnoreList, "ClearIgnoreList", 0);
    
    	long ExtObject::aClearIgnoreList(LPVAL theParams)
    	{
    		ignorelist.clear();
    		return 0;
    	}[/code:vtkaqhm8]
    
    RUNTIME:
    implementation of IsIgnoring
    [code:vtkaqhm8]	bool ExtObject::IsIgnoring(CRunObjType* objtype)
    	{
    		for (int j = 0; j < ignorelist.size(); j++) 
    		{
    			if (ignorelist[j]==objtype)
    			{
    				return true;
    			}
    		}
    		return false;
    	}[/code:vtkaqhm8]
    	
    Add IsIgnoring check to the beginning of OverlapTest
    [code:vtkaqhm8]	bool ExtObject::OverlapTest(CRunObject* pObj)
    	{
    		if(IsIgnoring(pObj->pType))
    			return false;
    		...
    		...
    		...
    	}[/code:vtkaqhm8]
    	
    Add two IsIgnoring checks to IsOverlapping, one for the platform check, and one for the Solid check, and change the check solids to manually checking one by one, so that each object can be checked against the ignore list
    	[code:vtkaqhm8]bool ExtObject::IsOverlapping( bool solids_only )
    	{
    		...
    		...
    		...
    		...
    					int count;
    					CRunObject **objs;
    					pRuntime->GetTypeSelectedInstances(pObstacles, objs, count);
    					for(int i = 0; i < count; i++) 
    					{
    
    						{
    							CRunObject* platform = objs[i]; // do here	
    							if (!IsIgnoring(platform->pType))
    							{
    								if(pRuntime->QueryCollision(pLink, platform))
    								{;
    								pLink->info.x = fx;
    								pLink->info.y = fy;
    								pRuntime->UpdateBoundingBox(pLink);
    								return true;
    								}
    							}
    
    						}
    					}
    	...
    	...
    	...
    	
    						if(platforms_inside.find(platform) ==  platforms_inside.end())
    						{
    							if(!IsIgnoring(platform->pType))
    							{
    								if(pRuntime->QueryCollision(pLink, platform))
    								{
    									pLink->info.x = fx;
    									pLink->info.y = fy;
    									pRuntime->UpdateBoundingBox(pLink);
    									return true;
    	...
    	...
    	...
    	
    	}
    [/code:vtkaqhm8]
  • um

    so, anyone know how to work that custom movement thing?

  • there is a command

    just type distance(somethingx,somethingy,somethingelsex,somethingelsey)

    and sorry

    at the end of that example I gave you

    previousx = sprite.x

    previousy=sprite.y

    previousx and previousy being private variables you made

    also,physics does have an expression for speed

    this won't do anything, but just to help you find the expressions, do something like

    sprite - set angle

    instead of typing in a new angle, double click a sprite with physics behavior, when it brings up the list of expressions, click on the physics tab, that's the list of physics expressions

    velocity x component and y component

  • to spawn sprites in specific locations with specific dimensions

    System : Create Object (let's you specify the location)

    Sprite.SetWidth

    Sprite.SetHeight

    actions after an object is created, and in the same event will apply to the object that was just created

    if you're using behaviors to move your sprites, most behaviors have an expression for speed,

    for instance, Set private variable MyCollisionSpeed to

    and then double click on the sprite, and click on the behaviors tab to find the expression for speed

    if you're using your own movement method, and no behavior, the way to determine speed is to set up two private variables, previousx, and previousy

    if you need absolute speed, or the specific x and y speed

    always

    set absspeed to distance(previousx,previousy,sprite.x,sprite.y)

    set xspeed to(sprite.x-previousx)

    set yspeed to (sprite.y-previousy)

  • rockin

  • if what you're asking is what I think you're asking, you may be looking for templates

    when you make an array of anything you can set a default for new array values

    templates are the defaults for super arrays

    in the example cap I didn't use a template because I wasn't sure if you knew about them

    but in this case you would say

    Action : Create Template

    template name "coord"

    add number array to {"t","coord"} "x" with default 0

    add number array to {"t","coord"} "y" with default 0

    the "t" as the first part of the address tells s you're adding to a special template super and not a regular super in your whole data structure

    you can use these as you can any other super, adding other supers inside if you wish, etc

    now when you create a super array you can do

    create super array "mycoords" with default "coord"

    now each time you add a super, it will already have the "x" and "y" arrays in it

    you can even fill the arrays with values in the templates if you wish, so each new super will be preloaded with preset values

    it may not seem immediately evident now, but there may be cases where you don't want the second super in an array to be exactly like the first, and vice versa, templates give you the ability to decide what goes in every super, without forcing you to put the same arrays in each one

    a few things of note, don't add objects into the templates, because object pointers change each time the program starts, so they would be invalid, you can add object types though. when you save and load supers to disk, you have the option to save your template data too. also, unlike arrays of anything else you can't access a super array outside of range and get the default

    meaning if your array has 5 supers you cant try to access index 9, and get access to the templates

    it really wouldn't make any logical sense anyway. but just so you know

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • why thank you minor

    btw, do you remember what the situation was where you needed a workaround

    it may be possible to bring this plugin up to a status of "use it this way"

    instead of my normal policy as of late "don't use it"

    I never had problems with it either

    another question, have you ever used it with multiple layouts?

    everytime people had problems using the plugin, their caps were always very different than I would have made them. there might be a dependable way to use this plugin yet

  • Whoa. So you mean spritefont hasn't caused you any problems? That's awesome

lucid's avatar

lucid

Member since 16 Jan, 2009

Twitter
lucid has 25 followers

Connect with lucid

Trophy Case

  • Entrepreneur Sold something in the asset store
  • Forum Contributor Made 100 posts in the forums
  • Forum Patron Made 500 posts in the forums
  • Forum Hero Made 1,000 posts in the forums
  • Coach One of your tutorials has over 1,000 readers
  • Regular Visitor Visited Construct.net 7 days in a row
  • RTFM Read the fabulous manual
  • Email Verified

Progress

24/44
How to earn trophies