script for 2nd text

gabo-hanzo

Well-known member
hello friends I don't know how to make scripts and I've only just started using some. But now I need a script to make a 2nd text appear in another frame that corresponds to the same animation when the enemy appears.
Example:
 

Attachments

  • Messenger_creation_D740AE60-489D-4848-B648-C29687E0FD0E.jpeg
    Messenger_creation_D740AE60-489D-4848-B648-C29687E0FD0E.jpeg
    28.8 KB · Views: 9
Sounds like you need to use this function:
C:
void spawn06(void vName, float fX, float fY, float fZ)
{
    //Spawns entity based on left screen edge and z axis
    //Auto adjust with camera's position
    //vName: Model name of entity to be spawned in.
    //fX: X distance relative to left edge
    //fY: Y height from ground
      //fZ: Z coordinate

    void self = getlocalvar("self"); //Get calling entity.
    void vSpawn; //Spawn object.
    int Direction = getentityproperty(self, "direction");
        int XPos = openborvariant("xpos"); //Get screen edge's position
        int YPos = openborvariant("ypos"); // Get camera position
        int Screen = openborvariant("hResolution"); // Get screen width

    clearspawnentry(); //Clear current spawn entry.
      setspawnentry("name", vName); //Acquire spawn entity by name.

   if (Direction == 0){ //Is entity facing left?                  
      fX = Screen-fX; //Reverse X direction to match facing and screen length
   }

    vSpawn = spawn(); //Spawn in entity.

    changeentityproperty(vSpawn, "position", fX + XPos, fZ + YPos, fY); //Set spawn location.
    return vSpawn; //Return spawn
}

You should copy that to your animationscript and use it like this:
Code:
anim    spawn
    delay    5
    offset    62 131
    frame    data/chars/willy/wait00.gif
    @cmd    spawn06 "textwilly" 320 0 244
    frame    data/chars/willy/wait00a.gif
    frame    data/chars/willy/wait01.gif
    frame    data/chars/willy/wait02.gif
    frame    data/chars/willy/wait03.gif
    frame    data/chars/willy/wait04.gif
    delay    25
    @cmd    spawn06 "textwilly2" 320 0 244
    frame    data/chars/willy/wait05.gif
    delay    15
    frame    data/chars/willy/wait06.gif
    frame    data/chars/willy/wait07.gif
 
Sounds like you need to use this function:
C:
void spawn06(void vName, float fX, float fY, float fZ)
{
    //Spawns entity based on left screen edge and z axis
    //Auto adjust with camera's position
    //vName: Model name of entity to be spawned in.
    //fX: X distance relative to left edge
    //fY: Y height from ground
      //fZ: Z coordinate

    void self = getlocalvar("self"); //Get calling entity.
    void vSpawn; //Spawn object.
    int Direction = getentityproperty(self, "direction");
        int XPos = openborvariant("xpos"); //Get screen edge's position
        int YPos = openborvariant("ypos"); // Get camera position
        int Screen = openborvariant("hResolution"); // Get screen width

    clearspawnentry(); //Clear current spawn entry.
      setspawnentry("name", vName); //Acquire spawn entity by name.

   if (Direction == 0){ //Is entity facing left?                 
      fX = Screen-fX; //Reverse X direction to match facing and screen length
   }

    vSpawn = spawn(); //Spawn in entity.

    changeentityproperty(vSpawn, "position", fX + XPos, fZ + YPos, fY); //Set spawn location.
    return vSpawn; //Return spawn
}

You should copy that to your animationscript and use it like this:
Code:
anim    spawn
    delay    5
    offset    62 131
    frame    data/chars/willy/wait00.gif
    @cmd    spawn06 "textwilly" 320 0 244
    frame    data/chars/willy/wait00a.gif
    frame    data/chars/willy/wait01.gif
    frame    data/chars/willy/wait02.gif
    frame    data/chars/willy/wait03.gif
    frame    data/chars/willy/wait04.gif
    delay    25
    @cmd    spawn06 "textwilly2" 320 0 244
    frame    data/chars/willy/wait05.gif
    delay    15
    frame    data/chars/willy/wait06.gif
    frame    data/chars/willy/wait07.gif
thank you very much master. I'll try.
 
Back
Top Bottom