Did you know? UBerserker loves the Dispersion Pistol.

Renamed: Triggerable Panel Help?

For questions and discussion about UnrealEd, UnrealScript, and other aspects of Unreal Engine design.

Moderators: Semfry, ividyon

User avatar LannFyre
Skaarj Scout Skaarj Scout
Posts: 31
Joined: 29 Dec 2014, 02:55

Subject: Renamed: Triggerable Panel Help?

Post Posted: 01 Mar 2015, 16:00

EDIT:

I now have a full script that compiles within Unreal Ed, but I have a problem: I don't know how to make a static mesh actor with my scripted textures. How do I make a static mesh actor with a scripted texture on it? I have the texture, but how do I add it and make the static mesh actor, then apply the script I have written into said actor?

Code: Select all

//=============================================================================
// RPG_DoorPanel
//=============================================================================
class RPG_DoorPanel expands StaticMeshActor;

enum EPanelMode
{
   PM_Locked,
    PM_Unlocked,
};
var() EPanelMode PanelMode;
var int PanelDisplay;

event PostBeginPlay()
{
   if ( ScriptedTexture(MultiSkins[1]) == none )
   {
      return;
   }
   else
   {
      GotoState('PanelDraw');
   }
}

State() PanelDraw
{   
   function Trigger( actor Other, pawn EventInstigator )
   {
      ScriptedTexture(MultiSkins[1]).NotifyActor = self;
       switch PanelMode
       {
          case PM_Locked:
             PanelDisplay = 0;
             Gotostate('Begin');
            case PM_Unlocked:
               PanelDisplay = 1;
               Gotostate('Begin');
       }
   }

Begin:
    Sleep(10);
}


/* RenderTexture will be edited later to diplay either "X" or "O". */
event RenderTexture( ScriptedTexture Tex)
{
   local  Color TheColor;

   TheColor.G = 255;
   TheColor.R = 255;
   if ( PanelDisplay == 1 )
      Tex.DrawColoredText( 76, 7, string(PanelDisplay), Font'CondemnedFont', TheColor);
   else if ( PanelDisplay == 0 )
      Tex.DrawColoredText( 78, 7, string(PanelDisplay), Font'CondemnedFont', TheColor);
}
Last edited by LannFyre on 05 Mar 2015, 23:31, edited 6 times in total.
way2goslugger

User avatar Draco Nihil
Skaarj Lord Skaarj Lord
Posts: 197
Joined: 06 Jun 2012, 21:18
Location: Independence, Kansas
Contact:

Subject: Re: How Do Triggers Work?

Post Posted: 03 Mar 2015, 03:13

Touch and Untouch are C++ driven event calls when a Actor intersects another Actor. (Note this can only happen if Collision is non blocking)

Trigger and Untrigger I don't really remember and I think it's specific to whatever the actor's script is.


Anyways the most basic Trigger functions as, whenever it intersects another Actor, Touch executes and then does a CauseEvent call to trigger whatever Event it's set to. (Event matching another actor's Tag)
“I am the dragon without a name...”

User avatar LannFyre
Skaarj Scout Skaarj Scout
Posts: 31
Joined: 29 Dec 2014, 02:55

Subject: OP HAS BEEN UPDATED

Post Posted: 05 Mar 2015, 21:02

OP has been updated:
> Changed from asking how triggers work to getting code to apply to a static mesh,
> Also how do I into static mesh with a scripted texture?
way2goslugger

User avatar salsaSkaarj
Gilded Claw Gilded Claw
Posts: 1862
Joined: 21 Apr 2009, 21:54
Location: on the prowl

Subject: Re: Renamed: Triggerable Panel Help?

Post Posted: 06 Mar 2015, 00:29

I'm not familiar with UnrealScript but do have a bit of programming knowledge and I've noticed a couple of time that Goto ... is used.
This increases the number of code lines and makes code less readable (and debugable), plus that it jumps out of an If statement (which, in large codeblocks makes tracebacks almost unfeasible. This used to be common practice (especially in batchfiles) but is not recommended (even frowned upon) nowadays.

Is there a specific reason you use this, or is it just because it writes faster (or another reason).

Just in case, I'm not criticising, I'm genuinly interested because I've been looking through some Unreal code and have some ideas which I would like to test (yes, dammit I might even try to make simple map and try to scipt some stuff).

User avatar LannFyre
Skaarj Scout Skaarj Scout
Posts: 31
Joined: 29 Dec 2014, 02:55

Subject: Re: Renamed: Triggerable Panel Help?

Post Posted: 06 Mar 2015, 00:40

I'll admit, the entire "state() PanelDraw" segment is me guessing based off of other scripts I have to work with. I haven't really been able to get an answer on this script from 3 different forums and a couple of people I can usually contact, so I'm floundering with this one. The script compiles within the editor, but I have no idea whether or not it works. I'm going to work in a second, but I'll be sure to upload my map and what I have done so far onto this topic through dropbox. I can hardly ever seem to get a straight answer, or sometimes any answer at all, and it's coming to the point where I might just give up and start learning how to use Unreal Engine 4. There's so little documentation left and I don't have a whole lot of people to ask for even proof reading of scripts, so it's just turning into an uphill battle against tanks.
way2goslugger


Who is online

Users browsing this forum: No registered users and 35 guests

Copyright © 2001-2024 UnrealSP.org

Powered by phpBB® Forum Software © phpBB Limited