Need helps

mersox

Active member
Hi guys. I am very close to releasing a new remake game but issues keep popping up. I have devoted too much time on these issues, and now I ask for your advice on a couple of points.

Counter for special attack
you know how in some games like Contra 3 of the Castlevania series, you have a special move that is finite and depends on how many bombs/hearts you have in your arsenal? I tried having something like this, so I implemented an MP bar. But the thing is that the MP bar behaves differently than in the given examples, because:
- You start the game with a full bar, when I wanted to start with just a few moves  (4 out of 20)  (I added script to get around this)
- After completing a level, MP increases a little (ugh)
- being a bar instead of a number makes it hard for players to know how many moves they have left.

What should I do? continue using MP, or is there another way? This sounds like I should be using a weapon with an ammo count, but already my character has many weapons and adding another one just for a special move sounds unnecessarily complicated.

Add wind feature
that pushes players back to the left. How can I accomplish this? I know D&D Rise of Warduke has this but my internet BLOWS and I haven't been able to download the pak and check it out for myself.

endlevel item that doesn't work
This one is getting on my nerves. I have this endlevel entity that when touched, should send player to branch "level03". Yet this idiot is sending me to the stage right after it in levels.txt and not to branch level03. And then to add insult to injury is gives players an extra life (WHY)

name bell_girl
type item
branch level03
health 0
shadow 0
nolife 1
offscreenkill 5000
score 0
didhitscript data/scripts/didhitscriptsilent2.c

anim idle
loop 1
delay 20
offset 26 55
itembox 23 17 7 39
frame data/chars/items/bell_girl_01.png
frame data/chars/items/bell_girl_02.png

Spawn coords getting funked up after diverting quickly to another branch
Does this sound familiar? I have this stage. There is a door. You enter a door and go to a bonus level. Bonus level ends and player is sent back to previous stage right where the door is. This works fine. What is weird is that everything else's spawn coords are shifted a few pixels (around 50?) to the right. What gives? Could this be due to scrollspeed  being set too fast?

This part is not fun at all guys
 
1- I would use a variable for that. Check Brand on my game, she uses this in her weapon mode.

2- BB made a game called oriental something, which has it. Also, in my game I use it too - check Whirlwind's code ( its the Blower function if I am not wrong)

3- I never used branch on header like that. I use BB's code to set a branch alias to be used as the branch name. Check "branchArrow" on my game.

4- maybe, I am not sure.
 
Counter for special attack

At first, I misunderstood that as counterattack for special attack. But it turns out you're talking about ammo counter
MP is not bad solution but you're right, aside of workaround to solve issues, it might conflict with MP system

Right now, the only thing crosses my mind is my LIFT and Scorer Horror game who has ammo counter
We may need to discuss more about this especially the ammo

Add wind feature

This one is pretty simple actually
Here's a windy FX made from modified conveyer belt entity:
Code:
name		WindFX
type		none
offscreenkill	3000


anim idle
@script
    void vSelf    = getlocalvar("self");             //Caller.
    void vEntity;                                     //Target entity placeholder.
    int iEntity;                                     //Entity enumeration holder.
    int iType;                                       //Entity type.
    int iName;                                       //Entity name.
    int iMax      = openborvariant("count_entities");       //Entity count.
    int Ex; int Ey; int Ez;

     //Enumerate and loop through entity collection.
    for(iEntity=0; iEntity<iMax; iEntity++){    
        vEntity = getentity(iEntity);                 //Get target entity from current loop.
        iType   = getentityproperty(vEntity, "type"); //Get target type.
        iName   = getentityproperty(vEntity, "name"); //Get target name

        //Enemy, item & player type?
        if(iType == openborconstant("TYPE_ENEMY") || iType == openborconstant("TYPE_PLAYER") || iType == openborconstant("TYPE_ITEM")){
          Ex = getentityproperty(vEntity, "x");
          Ey = getentityproperty(vEntity, "a");
          Ez = getentityproperty(vEntity, "z");

          if(Ex >= 600 && Ex <= 700 && Ez >= 400 && Ez <= 450){
            changeentityproperty(vEntity, "position", Ex+2);
          }
        }
    }
@end_script
	loop	1
	delay	2
	offset	10 10
	frame	data/chars/misc/empty.gif
	frame	data/chars/misc/empty.gif

I said modified from conveyer belt cause the only difference between that and wind FX is altitude checker i.e conveyer belts checks altitude while wind FX doesn't
This FX finds any player, enemies and items in x = 600 to x = 700 and z = 400 to z = 450 area and move them 2 pixels to the right every 2 centiseconds

endlevel item that doesn't work

Umm... AFAIK endlevel item should be declared like this:
Code:
name	 BranchF
type	 endlevel
shadow	 0
branch	 DAlley

anim idle
        loop    1
	delay	100
	offset	1 1
	bbox	0 0 20 20
	frame	data/chars/misc/empty.gif

You need to use endlevel type instead of item.
Well, endlevel type only works on ground so if you need endlevel entity which can be placed ontop of platforms or floating, you'll need something else + script

And then to add insult to injury is gives players an extra life (WHY)

In addition to that, any item which doesn't give health nor score will give extra life instead

What is weird is that everything else's spawn coords are shifted a few pixels (around 50?) to the right. What gives? Could this be due to scrollspeed  being set too fast?

No, even if your scrollspeed is 10, if you start right at scrollpos 0, the spawns should be fine
The real cause is scrollpos is moved BEFORE spawning other entities. My suggestion is to spawn other entities (assuming they are decorations or static entities) BEFORE moving scrollpos after player is spawned
 
O Ilusionista said:
1- I would use a variable for that. Check Brand on my game, she uses this in her weapon mode.

Thank you. I have been trying to copy her ammo counter and no luck so far after 5 hours (seriously). Any tips? Where do you assign initial ammo count, and how to make drawstring work?

Bloodbane said:
This one is pretty simple actually
Here's a windy FX made from modified conveyer belt entity:
You know you saved me at least a week of work, right? Thank you very much. I made some slight adjustments to change the direction, active area, and so that it affects players only.

Bloodbane said:
Umm... AFAIK endlevel item should be declared like this:
...
You need to use endlevel type instead of item.
Well, endlevel type only works on ground so if you need endlevel entity which can be placed ontop of platforms or floating, you'll need something else + script

I had tried type endlevel before but it didn't work. I tried again and now it does, turns out the issue is that I was using itembox instead of bbox. Anyway it works now and get this, the endlevel item is on top of a platform and still works! No script necessary.

Bloodbane said:
In addition to that, any item which doesn't give health nor score will give extra life instead
Good to know!


Bloodbane said:
No, even if your scrollspeed is 10, if you start right at scrollpos 0, the spawns should be fine
The real cause is scrollpos is moved BEFORE spawning other entities. My suggestion is to spawn other entities (assuming they are decorations or static entities) BEFORE moving scrollpos after player is spawned

Good call! I moved all spawns before scrollpos. In truth, I am not using scrollpos but rather a script on player spawn that changes x coords depending on gobal vars, but still, same principle.
I also adjusted scrollspeed from 1000 to 100 to avoid having all previous enemies appear all at once in the new position.
 
I remembered that elf from Map Demo has ammo counter system for his alternate arrows. You can download the mod and see how its done
Oh yes, since he's the only one with alternate arrows, he's using personal updatescript to show his arrows
 
Thank you. I have been trying to copy her ammo counter and no luck so far after 5 hours (seriously). Any tips? Where do you assign initial ammo count, and how to make drawstring work?

hehehe I can image. That system was the most difficult thing I´ve made on my game. It was a real pain.

The code isn't on Brand entity, but in "Brand_W" entity and its run by "ondrawscript".
ondrawscript      data/chars/brand/codes/weaponscript.c

With all my great respect for Blooodbane, to use drawstring on a "updatescript" is not a good idea, because its more resource intensive in comparsion with ondrawscript (as White Dragon had told me). I remember when WD had made an update on the engine and the previous code (which were run in updatescript) was slowing down the game. Once we moved to ondrawscript, everything went fine.

Open "weaponscript.c" and you will find 90% the code on it. The line which draws the ammo is
Code:
    // draws ammo count
    if(self == getplayerproperty(0,"ent")) drawstring(170,posy+10,1,"x"+getglobalvar("ammoControl"));
    if(self == getplayerproperty(1,"ent")) drawstring(320,posy+10,1,"x"+getglobalvar("ammoControl"));

The globalvariable "ammoControl" is what controls the ammout of ammo, as the name says (the other global variable is to control the icons). On "Brand_W" attack, you can see that I substract the ammount of ammo in every attack
Code:
         int ammoControl = getglobalvar("ammoControl");
        setglobalvar("ammoControl", ammoControl-1);
Each attack consumes 1 ammo, but special attacks consumes 2. If she doesn't have at least 2 bullets, she will execute a different animation.

The ammount of ammo that she will receive is on "Brand" freespecial6

Code:
        int ammo = 20;
        setglobalvar("ammoControl", ammo);

I hope you understand, because it was kinda complex to do. Or you can try BB's code, to see if it fits you more.
 
O Ilusionista said:
Thank you. I have been trying to copy her ammo counter and no luck so far after 5 hours (seriously). Any tips? Where do you assign initial ammo count, and how to make drawstring work?

hehehe I can image. That system was the most difficult thing I´ve made on my game. It was a real pain.

The code isn't on Brand entity, but in "Brand_W" entity and its run by "ondrawscript".
ondrawscript      data/chars/brand/codes/weaponscript.c

With all my great respect for Blooodbane, to use drawstring on a "updatescript" is not a good idea, because its more resource intensive in comparsion with ondrawscript (as White Dragon had told me). I remember when WD had made an update on the engine and the previous code (which were run in updatescript) was slowing down the game. Once we moved to ondrawscript, everything went fine.

Open "weaponscript.c" and you will find 90% the code on it. The line which draws the ammo is
Code:
    // draws ammo count
    if(self == getplayerproperty(0,"ent")) drawstring(170,posy+10,1,"x"+getglobalvar("ammoControl"));
    if(self == getplayerproperty(1,"ent")) drawstring(320,posy+10,1,"x"+getglobalvar("ammoControl"));

The globalvariable "ammoControl" is what controls the ammout of ammo, as the name says (the other global variable is to control the icons). On "Brand_W" attack, you can see that I substract the ammount of ammo in every attack
Code:
         int ammoControl = getglobalvar("ammoControl");
        setglobalvar("ammoControl", ammoControl-1);
Each attack consumes 1 ammo, but special attacks consumes 2. If she doesn't have at least 2 bullets, she will execute a different animation.

The ammount of ammo that she will receive is on "Brand" freespecial6

Code:
        int ammo = 20;
        setglobalvar("ammoControl", ammo);

I hope you understand, because it was kinda complex to do. Or you can try BB's code, to see if it fits you more.

Thanks!!! Alright so most of that stuff I had actually seen/adapted, EXCEPT for the last bit (int ammo). I was using a different script that was likely affecting the outcome. I also placed that last script in the level itself and not in the spawn animation of my character, because that way the game doesn't have to check stage number, which was also giving me trouble.

Lastly drawing ammo wasn't working but it turns out it was due to the placement in Y coord, once I changed that (from posy+10 to an actual number) it works.

Thank you so much buddy. Now the question is who takes credit for the script itself, you or White Dragon? FYI both you and Bloodbane are already listed in the credits, one full screen each (for sinusoid movement script and wind fx script, respectively)

 
O Ilusionista said:
I am glad it had worked :)
about the code, I made it myself. WD had helped me on one line (its even commented at the code) and with the tip about ondrawscript.

Perfect, thanks!

One thing I noticed, though. Ammo is not being drawn in all stages. Fifth stage of the game doesn't show it. It uses the same bgicon as the previous stages. Now, the different is that the first stages don't scroll (the tournament arena), but stage 5 onwards is a platformer. Could that be the reason? Do I need to add posx?
This is my code:
    // draws ammo count


    if(self == getplayerproperty(0,"ent")) drawstring(229,42,0,"x_"+getglobalvar("cranecounter"));
    if(self == getplayerproperty(1,"ent")) drawstring(320,posy+10,1,"x"+getglobalvar("cranecounter"));
 
Back
Top Bottom