Solved Minor Help

Question that is answered or resolved.
For some reason my player can't connect any attack after the first attack connects. The animations play but there is no move contact or damage. I have the attack boxes set as well as damage and pause times and I added atchain 1 2 4 3 in the header so I can't think of what could be causing this also the first attack seems to rarely to connect as well so any info on the issue would be appreciated.
 
For some reason when I add new characters to my mod the game will crash if the name in the txt file isn't the same as the name of the text file and name listed in models, ex. name in models/txt file - war_m, name in txt file war_machine. There are other characters in the game who have a different name in their txt file and a abbreviated name on the file itself is this something you guys have run into or can explain?
 
the game will crash if the name in the txt file isn't the same as the name of the text file and name listed in models

That's strange cause I have entities whose model name is different than text name in my mod and the mod works fine

I think the real crash cause is something else such as player model uses ATTACK5 animation while maxattacks is not set to 5 or higher yet
 
No, the text file name and the model name definitely don't have to match.  There are tons of games that depend on this behavior; people would notice if it were broken.  The model's name in its text file does have to match its declared name in models.txt, though.
 
I was planning to have them drop in from the top of the screen and for the didhitscript can you link to thread that contains the one I would need for this because there seems to be a couple different variations on the forum
 
Well, didhitscript is usually ran when entity successfully attacked something, and others who discussed about it, use the script for different purposes, that's why there are multiple variations of didhitscript

Anyways, for your item, here's an example of didhitscript script:

void main()
{//Script for to spawn apples
    void self = getlocalvar("self");
    void target = getlocalvar("damagetaker"); // Get player who picks the item
    int  PIndex = getentityproperty(target,"playerindex"); // Get player's index
    int  PScore = getplayerproperty(PIndex,"score"); // Get player's score
    int  x = getentityproperty(target, "x");
    int  z = getentityproperty(target, "z");

    changeplayerproperty(PIndex, "score", PScore-1); // Reduce score a bit
    spawn01("Apples",x,10,z);
    spawn01("Apples",x-50,10,z);
    spawn01("Apples",x+50,10,z);
    spawn01("Apples",x,10,z-10);
    spawn01("Apples",x,10,z+10);
}

void spawn01(void vName, float fX, float fY, float fZ)
{
//spawn01 (Generic spawner)
//Damon Vaughn Caskey
//07/06/2007
//
//Spawns entity next to caller.
//
//vName: Model name of entity to be spawned in.
//fX: X location
//fY: Y location
      //fZ: Z location

void self = getlocalvar("self"); //Get calling entity.
void vSpawn; //Spawn object.

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

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

changeentityproperty(vSpawn, "position", fX, fZ, fY); //Set spawn location. 
}

Save this script as call.c and place it in data/scripts folder
Yep, as you can read from description, this script will spawn 5 apples when the item is picked up. You can change it to other entity BUT make sure that it's loaded before
10 means apples will be spawned 10 pixels from ground
Here's how to set the script:

name Apple2
health 1
type item
gfxshadow 1
icon data/chars/misc/applicon.gif
didhitscript data/scripts/call.c


anim idle
delay 1000
offset 8 14
bbox 0 0 16 16
frame data/chars/misc/apple.gif

Text is blue is how you declare it

I think there would be more modifications required to suit your need but try this one and modify it a bit first :)
 
The scripts works great BB Ill have to tweak it for specific scenarios but its fine for now. Another question I have is about an attack similar to scorpion's spear grab or " Get over here" attack. I want the attack to grab the enemy and pull them to the player's position. I have it setup now where the attack puts the enemy in pain6 animation and that animation uses move to pull the enemy to the player but this sometimes puts the enemy behind the player or too far away any suggestions?
 
a small bump, here's a vid of wonder woman's attack from snes justice league task force where she grabs the opponent with her lasso and pulls them to her that is how I want the attack to work would I need script to do this or is there a mod with a similar attack I could reference?

https://youtu.be/NCLBA-yJAjU?t=26s
 
For some reason fmap isn't working for one of my enemies and I can't figure out why I know the palette is correct because the palette loads fine if set as the default palette but once I set it as fmap it doesn't switch palettes when frozen. Here's the enemy text I have other enemies using the same remap setup and it works fine this is the first time I've had this issue and I don't understand whats triggering it

Code:
name HForce2
type enemy
mp 40
health 300
gfxshadow   1
speed 8
aggression 120
subject_to_screen 1
hostile player npc
candamage player npc
antigrab  35
diesound data/sounds/dierobot.wav
throw 3 3
knockdowncount 10
atchain 1 2 1 3
noatflash 1
flash flashshock
load minirock2

offense normal 1.2

defense normal 0.7 15 0.7
defense normal2 0.7 15 0.7
defense shock 1.2
defense burn 0.8
defense freeze 0.8

fmap 1

remap   data/chars/Hydra/SF/alt.png data/chars/Hydra/SF/frze.gif

animationscript data/scripts/grabscript.c

 
Back
Top Bottom