1. Forums
  2. Discord
  3. About Mapcore
  4. Patreon Supporters
  • Login
  • Register
  • Search
This Thread
  • Everywhere
  • This Thread
  • This Forum
  • Articles
  • Pages
  • Forum
  • More Options
  1. Mapcore
  2. Discussions
  3. Level Design

Unreal Script Help

  • sarge mat
  • December 5, 2011 at 1:53 PM
  • sarge mat
    • December 5, 2011 at 1:53 PM
    • #1

    Have a few unreal script questions and an assignment due soon so any help would be greatly appreciated.

    First thing I am trying to do is give a vector the location of where an actor spawns and then give it a slight offset and can't for the life of me work out how. I am then using the vector to spawn another actor into the world at that location but it needs a slight offset value so its not in the excast same position. As the actor is placed in the editor It needs to work that out after it has spawned if you get what I mean and then add an offset.

    Tried a few things including:

    Code
    function SpawnAmmo(Vector SpawnLocation)
    
    
    {
    
    
    	//BoxOneLOf = SpawnLocation * BoxOneL;
    
    
    
    
    	Spawn(class 'TheBlueBoxLinkgunPack',,,SpawnLocation + SpawnOfSet);
    
    
    }
    Display More

    With out much luck. -------------------------Second I am having a hard time working

    Code
    StaticMeshComponent.SetMaterial();

    change the material of a mesh when called in other words

    Don't know if anyone has had experience with it but its looking for the values "int Element Index, Material Interface Material" and I can't really find any documentation explaining how to set it up .

    Cheers!

  • Froyok
    • December 5, 2011 at 3:16 PM
    • #2

    Example, if you want to calculate a point ahead of the player :

    Code
    Pawn.Location + (vector(pawn.rotation) * distance)

    But in your case :

    Code
    SpawnLocation = vect(0,0,0) //for example
    
    
     SpawnOfSet = vect(0,0,32)
    
    
    
    
    Spawn(class 'TheBlueBoxLinkgunPack',,,SpawnLocation + SpawnOfSet);

    I don't know very well the spawn command, but normaly there is no problem, do you get a specific error ?---

    Code
    var MaterialInstanceConstant matInst;
    
    
    
    
    matInst = new(None) Class'MaterialInstanceConstant';
    
    
    matInst.SetParent(StaticMeshComponent.GetMaterial(0));
    
    
    StaticMeshComponent.SetMaterial(0, matInst);
    Display More

    Example with a material instance, I guess it will work in the same way for a classic material.

  • sarge mat
    • December 5, 2011 at 3:47 PM
    • #3
    Quote from Froyok

    Example, if you want to calculate a point ahead of the player :

    Code
    Pawn.Location + (vector(pawn.rotation) * distance)

    But in your case :

    Code
    SpawnLocation = vect(0,0,0) //for example
    
    
     SpawnOfSet = vect(0,0,32)
    
    
    
    
    Spawn(class 'TheBlueBoxLinkgunPack',,,SpawnLocation + SpawnOfSet);

    I don't know very well the spawn command, but normaly there is no problem, do you get a specific error ?

    Example with a material instance, I guess it will work in the same way for a classic material.

    cheers Froyok

    What I have "works" but its getting it to know where the actor is in the world, the spawn defaults it to that location to start with but then there is no way to OfSet it. I think I am making things a bit complex for my self though. Cheers for the stuff on materials hope to get that working today.

  • Froyok
    • December 5, 2011 at 6:27 PM
    • #4
    Quote from sarge mat

    What I have "works" but its getting it to know where the actor is in the world, the spawn defaults it to that location to start with but then there is no way to OfSet it.

    I don't get it, why can't you offset it ? Since you offset his spawn location at start, you already know his true location.

  • sarge mat
    • December 5, 2011 at 6:57 PM
    • #5
    Quote from Froyok

    I don't get it, why can't you offset it ? Since you offset his spawn location at start, you already know his true location.

    If you leave the spawn location blank it defaults to the location of the actor that called its spawn but if you offset you also have to sent a location you are pretty much just adding to the value.

    Can prob live with it as long as I get everything else sorted

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!

Register Yourself Login
Discord

The Mapcore Discord is our lively IRC channel of the 2000s reborn. Chat about level design, gaming, and more.

Latest Posts

  1. Tangerine

    Harry Poster
    July 18, 2026 at 11:10 AM
  2. Any of the old guard still around? D:

    Warby
    July 12, 2026 at 8:23 PM
  3. About our archived forums

    Thrik
    June 30, 2026 at 2:12 PM
  4. Mapcore Discord

    mason_fan123
    June 24, 2026 at 8:52 PM
  5. [CS2] Valley

    Serialmapper
    June 22, 2026 at 11:56 AM
  6. Free Music / SFX Resource - Over 2500 Tracks

    Eric Matyas
    June 18, 2026 at 12:32 PM
  7. Pango [WIP]

    Elowen
    June 11, 2026 at 10:13 AM
  8. [CS2] Dvina

    Jeremy Rivera
    June 11, 2026 at 10:03 AM
  9. Bridges 2.0 by NEXSIDE, MAP SHOWCASE. ( Steam Workshop )

    MrTrane18
    June 1, 2026 at 7:46 PM
  10. Classic Maps Reborn For CS2

    SillySpaceCat
    May 31, 2026 at 10:33 PM
  1. Privacy Policy
  2. Contact
Powered by WoltLab Suite™