monster dies/ create a new one same spot?

  • Thread starter Thread starter bombernik
  • Start date Start date
B

bombernik

Guest
how can i make it so when a monster dies, after "10" secs it respawns a new unit. how can i do this without making many regions and making like 3000 triggers, because i want to make my own rpg. and i am unable to see any of the rpgs already out there with the trigger, do to protect.
 
Like this:

Code:
Events:
     A unit dies.
Conditions:
     (You will need some.)
Actions:
     Wait 10 seconds.
     Instantly revive (dying unit).
 
i tried that was a bit confusing, but i want for it to respawn in the same location that the units die, will i need to make like hundreds of regions with triggers?
should i make condition like if "sheep" dies?
 
sqrage: There is one for units as well.

bombernik: No, just use the trigger I posted. The condition would be maybe to see if the player unit a creep or something. You decide.
 
you used the word revive, but i want to create a new unit so it can drop items, it is going to be a rpg. any one that helps with the rpg is going to get credit.
 
In that case, replace that action with "Create Unit". Unfortuantely, I believe that any other item dropping requires triggers.
 
in GUI
CreepDie[1] = Unit Type
CreepTimer[1] = Timer
CreepDiePosition[1] = Region blah blah ( not sure .. i go home then do )


Event - A unit dies
Condition - Owner of triggering unit is equal to Netural Hostile( or any player )
Actions - (you need 3 variable & 2 triggers )
set CreepDie[1] equal to triggering unit
set CreepDiePosition[1] = Position of triggering unit
start a 1shot timer CreepTimer[1] that expires in 10 seconds
==========
2nd trigger
Event - CreepTimer[1] expires
Condition - N/A
Actions - Create 1 (CreepDie ) at ( CreepDiePosition ) for ( player )
=========

In JASS it could be shorter but iam at school .. i go home tell you more complicated stuff.

- DaFishy
 
im using this trigger for it and taken it from "Ryoko"
u need some variables first
- Creep_Position (Point Array)
- Creep_type (Unit-Type Array)
- Loop (integer)

first of all u must take all creeps types and position with this code (does not lag)

Code:
Unit Group - Pick every unit in (Units owned by Neutral Hostile) and do (Actions)
    Loop - Actions
        Set Creep_Type[Loop] = (Unit-type of (Picked unit))
        Set Creep_Position[Loop] = (Position of (Picked unit))
        Unit - Set the custom value of (Picked unit) to Loop
        Set Loop = (Loop + 1)

Afther taking them into variables you will create a custom script for it like that

Code:
function Trig_Revive_Creeps_Actions takes nothing returns nothing
    local integer CUSTOM
    set CUSTOM = GetUnitUserData(GetDyingUnit())
    call TriggerSleepAction( 30.00 )
    call CreateNUnitsAtLoc( 1, udg_Creep_Type[CUSTOM], Player(PLAYER_NEUTRAL_AGGRESSIVE), udg_Creep_Position[CUSTOM], bj_UNIT_FACING )
    call SetUnitUserData( GetLastCreatedUnit(), CUSTOM )
endfunction

//===========================================================================
function InitTrig_Revive_Creeps takes nothing returns nothing
    set gg_trg_Revive_Creeps = CreateTrigger(  )
    call TriggerRegisterPlayerUnitEventSimple( gg_trg_Revive_Creeps, Player(PLAYER_NEUTRAL_AGGRESSIVE), EVENT_PLAYER_UNIT_DEATH )
    call TriggerAddAction( gg_trg_Revive_Creeps, function Trig_Revive_Creeps_Actions )
endfunction

in this code above this line defines the creeps respawn time outs
call TriggerSleepAction( 30.00 ) that defines when a creep dies it respawns after 30 secs you can change the walue what evcer u want but 10 secs is too fast ;)

But that will need some more work if you want to create a big RPG for example if your creeps are changing on some spesific events or any levels,

you need to remowe all creeps from map wait 30 secs for posible death ones to revieve and remove them again ect...
 
Couldn't you just make it simpler?

Event:
Unit - Dies
Condition:
Either
Unit - Type equal to <UNIT TYPE>
Or
Unit - Triggering unit equal to <UNIT HERE>
Or
Owned by player (Neutral Hostile) condition.
Action:
Unit - Create 1 <Unit>

If need be just add some Give Item to hero triggers if you want them to have items or just add an extra trigger for a death drop. Not much simpler but should do it anyway.
 
Yoshimoto said:
Couldn't you just make it simpler?

Event:
Unit - Dies
Condition:
Either
Unit - Type equal to <UNIT TYPE>
Or
Unit - Triggering unit equal to <UNIT HERE>
Or
Owned by player (Neutral Hostile) condition.
Action:
Unit - Create 1 <Unit>

If need be just add some Give Item to hero triggers if you want them to have items or just add an extra trigger for a death drop. Not much simpler but should do it anyway.

normally its really quite simple to re create a dying unit.
but there is some annoying issues:

- When your hero kills the unit, the unit is respawning at same time and you need to kill it again and again. This will couse stacking at one point. and will be boring

- If you dont store the unit's position at somewhere, you need to create loads of regions and loads of triggers that controls that tingie

a unit dies in region bla bla or,
number of living units at region bla bla,
Create another unit ect...

however if unit has moved from this region your code does not work or create bilions of more units ect...
to make this kinda script perfect you need more complicated one then above

- with this code, you cannot create spesific actions like moving units or patroling like FFopenRPG

- the code that i wrote is creating a timer when a unit dies, and when timer finishes respawns this unit at same place when it stored first... If you modify your code your unit will respawn where it dies...

Simply, thats the simplest and the most perfect code that i can find around God bless JASS and Ryoko
:D
 
i used;

Unit - Create 1 (Unit-type of (Triggering unit)) for Player 12 (Brown) at (Position of (Triggering unit)) facing Default building facing degrees

but it has some downsides, it only revives units not creatures like "sheep". so i need some help to fix that, also thank you for all the info it really helped.
 
In the condition, make it an "or" condition, and check if the unit is neutral passive or neutral hostile.
 
u guys make it real hard

respawn
Events
Unit - A unit Dies
Conditions
(Owner of (Triggering unit)) Equal to Neutral Hostile
Actions
Wait 60.00 seconds
Unit - Create 1 (Unit-type of (Triggering unit)) for Neutral Hostile at (Position of (Triggering unit)) facing Default building facing (270.0) degrees
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • The Helper The Helper:
    Hey Ghan, whatever cron job its part of its not running its been the same for days. If it does not work can we remove it?
  • The Helper The Helper:
    LOL! A tweak job!
  • The Helper The Helper:
    this is the fix I get from that yeah this is hard to control. disabling bots is pretty much necessary as ai and other bots would push really old threads to the top. reduce weight of view count. disable guest view tracking if you really want to push active threads to the top. a bit of tinkering for a few days with the weights and other settings should get you a decent trending widget box.
  • Ghan Ghan:
    I changed the settings a bit.
  • Ghan Ghan:
    Narrowed it to 7 days for the half-life and set views to 0 weight.
  • The Helper The Helper:
    I dont think Trending would work for this forum it would be better to just have the last 5 posts from anywhere
  • Ghan Ghan:
    Probably will have to give it some time to update.
  • Ghan Ghan:
    I'm guessing it is not retroactive.
  • Ghan Ghan:
    Next on the punch list: Update the server to Ubuntu 24.04.
  • The Helper The Helper:
    Mad Lads is new I see it displays original post date
  • The Helper The Helper:
    as long as it changes it is good - it is good now it updated and its new stuff
  • The Helper The Helper:
    One thing I have noticed and I dont know if it is by design but like 1 out of 3 times I come to the site the Anubis screen just hangs open, if I refresh it will go away but sometimes it hangs
  • Ghan Ghan:
    I've seen that as well.
  • The Helper The Helper:
    Wow - the change in the stats are major. I kind of knew it was all bots but wow, to see the effect. Why the social media sites cant do something like this I have no idea.
  • Ghan Ghan:
    Probably inflates their numbers so they look better to advertisers.
  • The Helper The Helper:
    Yeah google does not filter those bots. I remember when Apex was doing Google ads I saw the same IPs in there as I was seeing here - google is totally tracking all those bots as traffic and most google traffic, at least ours, was all bots
  • The Helper The Helper:
    oh wow, i bet i can post x links now and do the webp pics now giggity
  • The Helper The Helper:
    ahh anubis blocks anyone that has javascript turned off
  • The Helper The Helper:
    Robot: HTTP client library - i love the new robot :)
  • The Helper The Helper:
    New Science News Forum and it starts out with 420 threads :)
  • The Helper The Helper:
    Technical Support forum name changed To Technology News, there is now a Tech, sci/tech and science forums now :)
  • The Helper The Helper:
    Happy Saturday! Hope everyone has a fantastic weekend!
  • Ghan Ghan:
    We are now on Ubuntu 24.04. Had some issues with the style after the OS/PHP upgrade but now resolved.
    +1
  • Ghan Ghan:
    PHP 8.3 now live
    +1

The Helper Discord

Staff online

Members online

Affiliates

Hive Workshop NUON Dome World Editor Tutorials
Back
Top